Performance of Linq To SQL versus Entity Framework

entity-framework linq-to-sql performance stored-procedures

Question

I have been searching for recent performance benchmarks that compare L2S and EF and couldnt find any that tested calling stored procedures using the released version of EF. So, I ran some of my own tests and found some interesting results.

Do these results look right? Should I be testing it in a different way?

One instance of the context, one call of the sproc: (dead link)

One instance of the context, multiple calls of the same sproc: (dead link)

Multiple instances of the context, multiple calls of the same sproc: (dead link)

1
15
7/9/2013 12:58:44 AM

Accepted Answer

I think you should test it in a somewhat different way, in order to distinguish startup costs vs. execution costs. The Entity Framework, in particular, has substantial startup costs resulting from the need to compile database views (although you can do this in advance). Likewise, LINQ has a notion of a compiled query, which would be appropriate if executing a query multiple times.

For many applications, query execution costs will be more important than startup costs. For some, the opposite may be true. Since the performance characteristics of these are different, I think it's important to distinguish them. In particular, averaging startup costs into the average cost of a query executed repeatedly is misleading.

7
11/3/2008 2:37:21 PM

Popular Answer

This looks to be a pretty measurement of performance between LINQ to SQL and Entity Framework.

http://toomanylayers.blogspot.com/2009/01/entity-framework-and-linq-to-sql.html



Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow