Speed up view generation process
View generation process is too slow. I tested it with 400 entities and it takes about 15 seconds regardless of using a DB First or Code First approach. I know views can be pre-generated in DB First scenario (although I don't think that a first class product should rely on such workarounds), but that can't be done with Code First.
EF6.1 contains additional tweaks to the substantial improvements made in EF6 that improve the performance in certain scenarios deep and complex inheritance with associations in subtypes. For all the models we have tested recently, even for those with thousands of entities and associations and great complexity, view generation is completed within a few seconds.
If there are models out there for which even EF 6.1 cannot generate views quickly, we would like to hear from them. Please file a bug at http://entityframework.codeplex.com/WorkItem/Create and attach the model.
EF 6 alpha 2 includes improvements in view generation performance for large models contributed by a member of the EF’s open source community. We are working on further improvements for complex models. See the alpha 2 announcement here: http://blogs.msdn.com/b/adonet/archive/2012/12/10/ef6-alpha-2-available-on-nuget.aspx.
Anil Mujagic commented
Here's the test solution I'm using for benchmarks: https://github.com/anilmujagic/OrmBenchmark
It includes the scripts for DB with 400 tables and test data.
I will try to extract some entities (and clone them) so that i can provide you a model. Once i have it, where should i provide the files?
We are definitively interested in improving the performance for any EF models that still lead to slow view generation after the changes we made in EF6, but we need models that we can use to reproduce the behavior. Any chances you could provide yours? An obfuscated version of the model would work.
Please improve this!
I am working with EF 6 Alpha 3 and View generation is still extremely slow!
I have 300 real-world entities (5 - 15 properties, 5-10 associations) and view generation takes up to 2 minutes!
Pre-Compiling views is cumbersome as there is no api where i can plug in the pregeneration into the application code so that the developer does not have to trigger it manually. Also waiting 2 minutes for pre-compiling views is way too much!
I have tested the same entity-set with nhibernate were the same process takes just about 12 seconds.
Scott Stafford commented
My numbers are much slower than yours with our real-world ~400 entity database schema. However, one thing to note: it is possible (now) to generate via Code First: http://stackoverflow.com/a/10770346/237091