Hello,
In our project we use huge models, and it take significant time to initialize database (PC is Core i7-2600 16GB).
For example, in model with 200 types (tables) each with 20-23 properties (columns) initialize time for EF5 is 17 seconds, but with EF6-beta1 this time increases to 55 seconds, 3 times more.
Here is my measures for 200 types:
* DropCreateDatabaseAlways Initializer
* 17 122 milliseconds in EF 5
* 55 829 milliseconds in EF 6-beta1
* null Initializer
* 3 302 milliseconds in EF 5
* 12 788 milliseconds in EF 6-beta1
Code example https://bitbucket.org/pil0t/eftestinit
Is there any way to optimize perfomance of database init?
Comments: There were three main factors affecting this scenario: * Regression 1 - described and addressed by [workitem 1194](https://entityframework.codeplex.com/workitem/1194). This was the biggest chunk of the regression and after it got fixed numbers in EF6 look much closer to those in EF5. Making use of the latest code as of this writing will not see such a great performance difference when initializing the models. * Regression 2 - introduced by changeset [02e6f343a1bb](https://entityframework.codeplex.com/SourceControl/changeset/02e6f343a1bbca487bd0e5e69599b8406722e60f#file_diff_src/EntityFramework/ModelConfiguration/Configuration/Types/EntityTypeConfiguration.cs). Method EntityTypeConfiguration.ConfigureDependentKeys is now updating the PrimitiveType of an instance and in the process reconstructing the TypeUsage object. Item described and tracked with [workitem 1429](https://entityframework.codeplex.com/workitem/1429). * Regression 3 - introduced by changeset [bd79d7447739](https://entityframework.codeplex.com/SourceControl/changeset/bd79d74477393c20d050837419a0d5731de2fa12). Described and tracked by [workitem 1422](https://entityframework.codeplex.com/workitem/1422).
In our project we use huge models, and it take significant time to initialize database (PC is Core i7-2600 16GB).
For example, in model with 200 types (tables) each with 20-23 properties (columns) initialize time for EF5 is 17 seconds, but with EF6-beta1 this time increases to 55 seconds, 3 times more.
Here is my measures for 200 types:
* DropCreateDatabaseAlways Initializer
* 17 122 milliseconds in EF 5
* 55 829 milliseconds in EF 6-beta1
* null Initializer
* 3 302 milliseconds in EF 5
* 12 788 milliseconds in EF 6-beta1
Code example https://bitbucket.org/pil0t/eftestinit
Is there any way to optimize perfomance of database init?
Comments: There were three main factors affecting this scenario: * Regression 1 - described and addressed by [workitem 1194](https://entityframework.codeplex.com/workitem/1194). This was the biggest chunk of the regression and after it got fixed numbers in EF6 look much closer to those in EF5. Making use of the latest code as of this writing will not see such a great performance difference when initializing the models. * Regression 2 - introduced by changeset [02e6f343a1bb](https://entityframework.codeplex.com/SourceControl/changeset/02e6f343a1bbca487bd0e5e69599b8406722e60f#file_diff_src/EntityFramework/ModelConfiguration/Configuration/Types/EntityTypeConfiguration.cs). Method EntityTypeConfiguration.ConfigureDependentKeys is now updating the PrimitiveType of an instance and in the process reconstructing the TypeUsage object. Item described and tracked with [workitem 1429](https://entityframework.codeplex.com/workitem/1429). * Regression 3 - introduced by changeset [bd79d7447739](https://entityframework.codeplex.com/SourceControl/changeset/bd79d74477393c20d050837419a0d5731de2fa12). Described and tracked by [workitem 1422](https://entityframework.codeplex.com/workitem/1422).