How to increase load performance of referenced dll's on startup?
c#-4.0, devexpress, dll, performance, winforms
Solution
You have a cold start problem. Cold start times are dominated by the disk drive, locating the assemblies on disk. A warm start is fast, the assemblies are present in the file system cache so don't have to be located on the slow disk.
Using ngen.exe makes cold starts worse, it requires another file to be found. The reason that Microsoft recommends that you only ever use ngen.exe on large assemblies. Jitting can actually be faster than finding the ngen image file.
There's not that much you can do about slow cold starts, it is a pure hardware problem and you need a faster disk to truly get ahead. Making sure it is defragged well certainly helps. An SSD is very nice. You could use ILMerge.exe to reduce the number of DLLs that need to be found. It is a problem that tends to solve itself over time if the user starts the program often enough after machine startup. Windows learns the usage pattern and prefetches executables so they'll be in the file system cache when needed. A feature called SuperFetch.
Fwiw, slow cold starts are not exclusive to .NET programs, unmanaged programs that use lots of DLLs have this problem too. Office and Adobe Reader are common examples. They cheat, they install an "optimizer" that runs at login. All it does is get those DLLs into the file system cache. Very annoying. You could do this too, of course I can't recommend that.
Problem
I have an windows forms application on .NET 4 framework and using Devexpress components. In first run of my application it wait 20 or 30 seconds for loading assemblies. After that it runs like a rocket :) How can I solve this? I googled some and found NGEN.exe. I don't have any idea NGEN is usable or not. Is there any another simple way for increase load assembly speed? What do you prefer?