Answered by:
EF6 performance improvements? Where?

Question
-
Improved context warm-up time and query performance were touted as "features" of EF6. We just updated a project with a large data context from EF5 to EF6 today and found that, far from getting improvements, we suffered substantial performance degradation. Context warm-up times have increased by ~30% and query times for the simplest query, e.g. context.Customers.ToList(), have increased by ~15%. Fairly disappointing.Wednesday, September 25, 2013 11:11 PM
Answers
-
Hi Dane,
EF6 does include some significant improvements in the area of View Generation - these will be particularly noticeable if you have a large model with a lot of relationships/inheritance. That said, we have recently identified a number of issues where warm up time in other areas has regressed - especially when working with Code First models. In cases where the View Generation benefit is minimal this can result in an increased overall warm up time.
We are working on improving performance in these areas at the moment. While the fixes may not be included in the 6.0.0 release itself we'll have something available with the performance improvements/fixes ASAP.
~Rowan
We are seeing a lot of great Entity Framework questions (and answers) from the community on Stack Overflow. As a result, our team is going to spend more time reading and answering questions posted on Stack Overflow. We would encourage you to post questions on Stack Overflow using the entity-framework tag. We will also continue to monitor the Entity Framework forum.
- Proposed as answer by Fred Bao Monday, September 30, 2013 5:00 AM
- Marked as answer by Dane Vinson Monday, September 30, 2013 3:26 PM
Friday, September 27, 2013 5:42 PM
All replies
-
Hello,
Thanks for your feedback regarding the problem, I will send your feedback to the dev team and see if there is anything we can do.
And about Entity Framework 6, there is a link below that shows what is new in it: http://entityframework.codeplex.com/wikipage?title=specs
Thanks for your understanding.
<THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
Thanks
MSDN Community Support
Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.Thursday, September 26, 2013 8:13 AM -
Hi Dane,
EF6 does include some significant improvements in the area of View Generation - these will be particularly noticeable if you have a large model with a lot of relationships/inheritance. That said, we have recently identified a number of issues where warm up time in other areas has regressed - especially when working with Code First models. In cases where the View Generation benefit is minimal this can result in an increased overall warm up time.
We are working on improving performance in these areas at the moment. While the fixes may not be included in the 6.0.0 release itself we'll have something available with the performance improvements/fixes ASAP.
~Rowan
We are seeing a lot of great Entity Framework questions (and answers) from the community on Stack Overflow. As a result, our team is going to spend more time reading and answering questions posted on Stack Overflow. We would encourage you to post questions on Stack Overflow using the entity-framework tag. We will also continue to monitor the Entity Framework forum.
- Proposed as answer by Fred Bao Monday, September 30, 2013 5:00 AM
- Marked as answer by Dane Vinson Monday, September 30, 2013 3:26 PM
Friday, September 27, 2013 5:42 PM -
Rowan:
Thanks for the response. I've marked it as answered and I understand what you've said. It is fairly disappointing however. One of the claims about EF6 for the past several months has been improved context warm-up time for large complex models. This is exactly the situation we find ourselves in and so we've been quite excited about that feature. We were pretty disappointed to discover that not only isn't there an improved warm-up time but that the warm-up time has degraded significantly from EF5, especially for the Code First scenario. For us the benefits of Code First are tremendous but the performance overhead is becoming onerous.
Monday, September 30, 2013 3:32 PM -
Hello Dane,
Understood. Regarding startup time, some of the improvements Rowan described above will be included shortly in our nightly builds. We will keep this thread updated so that you can test them. Hopefully it will address your concerns. As Rowan mentioned, we are planning to do a patch release with the improvements shortly after EF6.0 RTM to minimize the impact.
Regarding the ~15% query regression you are seeing, would it be possible for you to provide a repro?
Thanks,
DiegoThis posting is provided "AS IS" with no warranties, and confers no rights.
Monday, September 30, 2013 11:05 PM -
Hi Diego, Unfortunately the testing I did originally was against a in-Development version of our database and there's no way I could make that public. I did a bunch of subsequent testing using the AdventureWorks2012 database (though I had to modify it slightly to get EF to generate models) to test EF5 vs. EF6 and Code First vs. Database First. Here's a quick overview of the results I found in that testing:
EF5 Code First: Warm-up time 5.1 s, average query time 2.9 s
EF5 Database First: Warm-up time 1.9 s, average query time 2.8 s
EF6 Code First: Warm-up time 12 s, average query time 5.1 s
EF6 Database First: Warm-up time 6 s, average query time 5.1 s
I documented this all in another post here though the absolute numbers (but not the trends) are different than what I just quoted due to the fact I did the tests on two different machines. The query times shown above between EF5 and EF6 are substantially more than the +15% I quoted on the original post. I'd be very happy to make the project I used to generate the above available if you'd let me know where to send it. The solution itself is pretty small (4 separate console app projects) so I could send that as an attachment but the database is larger than can be easily attached to an email.
- Edited by Dane Vinson Monday, September 30, 2013 11:31 PM
Monday, September 30, 2013 11:30 PM -
Hi Dane,
Would it be possible to have the repro code and the database uploaded to SkyDrive and then share the link with us via email? You can email me the link to daobando at Microsoft. Thank you for your analysis, we're working on making EF as responsive as possible.
David.
Tuesday, October 1, 2013 1:11 AM -
Hi David,
I uploaded the project and database in a .zip to skydrive and shared it with you. Let me know if there's any issues.
Dane
- Edited by Dane Vinson Monday, October 7, 2013 11:39 PM
Tuesday, October 1, 2013 4:59 PM -
I have met the same problems!
I think the ef team should test it before they released ef6.0.
The performance problems (warm-up and query) are very easy to find, just make sure you db has more than 50 tables, it would show the same result as Dane did.
Disappoint me too.
Friday, January 3, 2014 9:36 AM -
Is there any update on this topic? We just upgraded from EF5 to EF6.1 and experienced quite a bit of slowness. So much so, that timeouts occurred throughout the system. We probably have over 100 tables.Wednesday, April 30, 2014 7:57 PM
-
Any Update on EF6 performance ? Especially Warmup and query time ?
Ram
Thursday, June 19, 2014 4:09 PM -
We have made (and we will continue to make) additional performance improvements in successive versions of EF 6.x. To get a good sample of the improvements made you can use this query on our bug database:
https://entityframework.codeplex.com/workitem/list/advanced?keyword=performance&status=All&type=All&priority=All&release=EF%206.0.1|EF%206.0.2|EF%206.1.0|EF%206.1.1&assignedTo=All&component=All&sortField=Id&sortDirection=Descending&page=0&reasonClosed=FixedWe also recently updated our whitepaper on performance to account for differences in EF 6.x You can find it here:
http://msdn.microsoft.com/en-us/data/hh949853.aspx
Hope this helps,
Diego
This posting is provided "AS IS" with no warranties, and confers no rights.
Thursday, June 19, 2014 4:57 PM