I have a pretty large and complex winforms application. In an effort to reduce the startup time, I pre-generated serialization assemblies using the following batch file.
; delete any existing serialization assemblies
del *XmlSerializers.dll
; gen new serialization assemblies
for %%a in (*.dll) do sgen /assembly:%%a
; delete .deleted files (generated for assemblies which do not allow serialization)
del *.dll.deleted*
However, to my surprise, the startup time actually went up from 4.6 seconds to 6.1 seconds - a jump of 1.5 seconds. This held true whether it was a cold start or warm.
So, questions:
You should profile your application to see why startup time is increasing. Perfview will be a good tool to do so.
If too much time is spent in JITtting, consider NGEN your application. If too many pages are loaded, consider using mpgo optimization if you're running under .Net 4.5
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With