Updated 9/30/2008: Added association and properties (fields) count, and LINQ to SQL model generation times.
Julie Lerman discusses in Entity Framework Designer and Large Databases of 8/19/2008 how the number of tables in a database affects the time to generate Entity Framework (EF) v1 RTM’s Entity Data Model (EDM). She says:
According to Noam Ben-Ami who is on the team that works on the designer, the performance for the designer itself should have “typically reasonable” performance for up to “about 120 tables, after which things begin slowing down.”
Her test with a 400-table database took the EDM Wizard about 20 seconds to generate the visual model. “Saving the model took about 1/2 minute as it generated the classes.”
I noted in my LINQ and Entity Framework Posts for 8/12/2008 post, Kristofer Andersson of Huageti Systems gave up after the EDM Wizard spent three hours attempting to create and EDM of a 1,000-table SQL Server database.
A 120-table database (from Huageti Systems), which is typical of those used by a reservation system for small airlines but contains no data, took 50 seconds to generate the model in the EDM Designer. The same operation with LINQ to SQL takes 22 seconds.
Update 9/30/2008: The entities have a total of 205 associations and 1190 scalar properties (9.9 properties/entity.)
What’s more important, in my opinion, is the time to generate the EDM at runtime. The following table lists the times to instantiate and cache the runtime EDM with LINQ to SQL and Entity Framework in a WinForm client.
Times to Instantiate a 120-Table Entity Data Model in a Windows Form Client
LINQ to SQL
|Data/ObjectContext initiation time (first), s.|| |
|ObjectContext initiation time (precompiled), s.|| |
|Data/ObjectContext recreation time (next), s.|| |
Clearly, 9.5 seconds to cache the EDM is excessive and waiting 2 seconds for a precompiled version to open isn’t satisfactory. (The preceding times were generated with EF v1 Beta; there’s no significant difference with EF v1 RTM. See my Comparison of Entity Framework and LINQ to SQL Projects Using a 120-Table Database post of July 12, 2008.)
Update 8/19/2008: ObjectContext initiation consumes about 60% to 80% of CPU time for the full 9+ seconds. The metadata cache size (without data) is 21 MB.
I wonder how long it would take a 400-table EDM to open. Perhaps 30 seconds, if that’s what Julie meant by “saving the model.”