Tell me, if my code will always run on a specific processor, and if I have this information during installation - is there any chance that I can avoid JIT?
You do not need to avoid JIT if you have processor information during installation.
If you compile your modules using the / platform: [x86 / x64 / IA64] switch, the compiler will include this information in the resulting PE file so that the CLR executes the JIT code in the corresponding native processor code and optimizes the code for this CPU architecture.
NGEN, , JITting. NGEN'd -NGEN'd, , NGEN'd .
NGEN , JIT .
: , .
NGEN:
(Ngen.exe) - , . Ngen.exe , , , . " " (JIT) ...Ngen.exe . Native Image...
(Ngen.exe) - , . Ngen.exe , , , . " " (JIT) ...
Ngen.exe . Native Image...
NGEN - , , JIT-ed- , "" , NGEN . , .config:
static readonly bool _EnableLogging = LoadFromConfigFile("EnableLogging"); if (_EnableLogging && log.IsDebugEnabled) { //Do some logging }
NGEN if , , _EnableLogging. JIT , , , if - , JIT if , , , .