Ngen or not? The rules haven't changed very much since 2004

I still get questions that amount to "should I ngen my <something>" from time to time and the best answer I can give is still "it depends."  I wrote this article many years ago, and I'd say it's still pretty accurate:

Essentially the situation is this: if you ngen your IL then of course the jit will not have to run but you will have to do more I/O because the compiled code is bigger than the IL.  If that I/O is likely to be cached because either:

  1. The code is going to be loaded "a goodly amount of time" after ice cold startup and it's commonly used so superfetch is likely to fetch it, or
  2. The code is in a library shared by many programs and so only one of those programs at most will have to actually read it at full cost

then it's likely that ngen will help you overall.

If that's not the case then ngen isn't likely to help you.  But really you need to measure for yourself.

Remember also that the code generation for ngen'd binaries is going to tend to optimize for maximum sharability which may come at a (typically small) cost in raw speed so that's a factor as well.

The most common framework DLLs, like mscorlib, system.dll and friends, tend to be get the most benefits from ngen.  Single-use application libraries and executables tend to get the least benefit.

It's really hard to say more than that with any kind of precision.