3 ms·
The compiler you're thinking of compiles to MSIL - bytecode. The run time still needs to compile the bytecode into machine code, and this is what the JIT is res
by jsmeaton 13y ago
The compiler you're thinking of compiles to MSIL - bytecode. The run time still needs to compile the bytecode into machine code, and this is what the JIT is responsible for.
- millstone 13y agoI guess I was thinking of the NGen compiler. My (very vague) memory is that NGen is run at installation time. Is this run after NGen, or instead of it?
- pjmlp 13y agoIn .NET bytecodes are always compiled to native code before execution, there aren't any interpretation steps like in other management environments. By default, MSIL gets compiled to native code on load via a JIT compiler. The developers that care about performance on startup, can choose to use ngen at installion time, thus taking the JIT out of the equation. The only issue with ngen is that it isn't able to perform all optimizations that the JIT is capable of. So this new JIT improves the current JIT and most likely, the optimizer will also be used by ngen.
- freikev 13y agoNGen invokes the JIT compiler, so your install time (and .NET servicing time) should be quite a bit lower, once we release RyuJIT as part of the full .NET Runtime. Probably less important, but still important enough for a lot of customers to complain :-)
- josteink 13y agoMy (very vague) memory is that NGen is run at installation time As far as I know, ngen is only used if you decide to use it. There's nothing automatic about installed code being ngen'ed.
- apardoe 13y agoNative image generation differs based on the platform. There is automatic native image generation in Windows: see http://msdn.microsoft.com/en-us/library/hh691758.aspx http://msdn.microsoft.com/en-us/library/hh691758.aspx for details. There's also Triton on Windows Phone: http://channel9.msdn.com/Events/Build/2012/3-005 http://channel9.msdn.com/Events/Build/2012/3-005. In the classic Windows Desktop case, however, you're right: you need to NGen your code yourself or call NGen as a custom action from your installer. --Andrew Pardoe [MSFT]