On Jul 25, 8:30*am, "Peter Duniho" <NpOeStPe...@nnowslpianmk.com>
wrote:
> But as far as I know, in C# all of the code in an assembly is compiled *
> when the assembly is first loaded.
Nope, it's still JITted, though unlike Java which tries to postpone
this (i.e. it will first run the method through interpreter several
times before attempting the more expensive JITting), CLR will JIT
immediately on the first call. But not on assembly load.
Here's an article that covers it in more detail (among other things):
http://msdn.microsoft.com/en-us/magazine/cc163791.aspx
It actually explains the detailed layout of object vtables and format
JITter thunks. The latter is mostly applicable to 2.0 runtime as well
- I've successfully used the information in the article to patch those
thunks at runtime.
>*The "global assembly cache" is, if I recall correctly, where the compiled code is then stored for future *
> executions.
Not really. NGen does indeed store precompiled assemblies in GAC, but
GAC also stored plain assemblies as well. It's whatever you put there
using gacutil.