I'm reading second book and it's still not obvious.
My question is: How many times IL language is compiled: a) Every time from the beginning durning the execution of application. b) Once, after first execution.
It's a) -Every time the program is executed. As bits of the assemblies are executed, the JITter compiles and caches them in memory. So each bit is only compiled once before it's run, then run natively each time after that. However, these compiled bits are only stored in memory and are thrown away after the program terminates.
If you want to, you can you can use ngen to create and cache compiled images, in which case the answer becomes C) - Once, before execution.
An important special-case clarification ( from svick ). Note that on Windows 8, an assembly that targets .Net 4.5 or later, and is either installed into the GAC or comes from the Windows Store is a candidate for automatic native image generation. These native images are created by the scheduled NGen Task based on usage.
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