Daily Archives: February 5, 2008

Entity Framework Performance

One of the major accomplishments of EF Beta3 was that the performance of materializing objects through Object Services (that means with Linq to Entities or with Entity SQL) was improved significantly. So significantly that  they are almost comparable with querying through EntityClient which streams data into a datareader.

I did a number of experiments that I hadn’t blogged about yet but did ask on the forums [EF: Best way to compare apples to apples when comparing perf of materialized objects vs datareader?] where I learned that ViewGeneration was the most time consuming part of the query process.

In the end, I had found this when performing the same query with LINQ to Entities, with EntityClient and with ADO.NET after separating the ViewGeneration time out in order to do fair comparisons. You can use EDMGen to pre-compile a query so that the expense of ViewGeneration becomes negligible at runtime.

  • ViewGeneration: ranges around 1110 milliseconds
  • Iterate through Materialized Objects: 14 to 15 ms
  • Iterate EDM shaped data through datareader: 17 to 18 ms
  • Iterated sqlclient datareader (classic ado.net): about 4 ms

BUT! Even better, Brian Dawson has written an extensive blog post about performance in Entity Framework: Exploring the Performance of the ADO.NET Entity Framework – Part 1. The post is filled with charts and graphs and is very enlightening. Brian even has a pie chart showing ViewGeneration as 56% of the time for performing a query.

The post digs very deeply into the query and object materialization pipeline, which, to someone like me, is dangerously close to pillow talk! 😉

And it’s only Part 1!

TechDays Paris – Fabulous Silverlight website and Matthieu Mezil does Entity Framework and LINQ

Matthieu Mezil is presenting on Entity Framework and LINQ (and VSTO) at next week’s first (?) .NET event in Paris: TechDays 2008.

I wanted to see what else was going on and found the website (by BrainSonic) and boy is this a fantastic Silverlight implementation. Even if you don’t know French, I highly recommend checking out the website, if for no other reason than to be inspired!

This is just but a small tidbit. After searching for Mezil, it spun (literally) these three items on to the calendar.

There’s more, but I’ll let you go play with it yourself.

Matthieu has been building up his EF expertise as well as using the forums as a means to challenge himself to learning more and sharing what he’s learned.