Hello Goran,
I just wanted to provide you and update on this investigation. First of all, regarding the start up time regression you observed, we were able to repro and we believe we understand better what is happening. In our environment, the startup time looks like this:
This helped us realize that the WPF application was simply no loading the native images produced by ngen. The reason is that while the console application would ran in 32-bit mode, a WPF application would ran in 64-bit in a 64-bit operating system by default. There are actually two different versions of ngen.exe that produce 32 and 64-bit native images. In order to reduce the start up time for the WPF application you need to use a version of ngen.exe from the c:\windows\microsoft.net\framework64 directory or alternatively run the ngen install command from the x64 Native Tools Command Prompt.
We also were able to shave approximately 100 additional milliseconds from start up time by also running ngen install on the EF provider, e.g. EntityFramework.SqlServer.dll.
All in all, once ngen install is applied successfully, our results show that the repro you provided starts faster with recent builds of EF 6.0.2 than with EF 5.0.
To address this issue we will provide improved instructions to use ngen in the future.
In the meanwhile, we haven reproduced the other two issues you described. I will give Pawel (the author of the view generation template for EF6) the heads up on the type loading exception.
Hope this helps,
Diego
I just wanted to provide you and update on this investigation. First of all, regarding the start up time regression you observed, we were able to repro and we believe we understand better what is happening. In our environment, the startup time looks like this:
- EF 6.0.2 with the WPF application you provided: ~3400 ms
-
EF 6.0.2 with the model you provided inside a console application ~ 2600 ms
This helped us realize that the WPF application was simply no loading the native images produced by ngen. The reason is that while the console application would ran in 32-bit mode, a WPF application would ran in 64-bit in a 64-bit operating system by default. There are actually two different versions of ngen.exe that produce 32 and 64-bit native images. In order to reduce the start up time for the WPF application you need to use a version of ngen.exe from the c:\windows\microsoft.net\framework64 directory or alternatively run the ngen install command from the x64 Native Tools Command Prompt.
We also were able to shave approximately 100 additional milliseconds from start up time by also running ngen install on the EF provider, e.g. EntityFramework.SqlServer.dll.
All in all, once ngen install is applied successfully, our results show that the repro you provided starts faster with recent builds of EF 6.0.2 than with EF 5.0.
To address this issue we will provide improved instructions to use ngen in the future.
In the meanwhile, we haven reproduced the other two issues you described. I will give Pawel (the author of the view generation template for EF6) the heads up on the type loading exception.
Hope this helps,
Diego