Forcing JIT of assemblies

  • Thread starter Thread starter Clive Dixon
  • Start date Start date
C

Clive Dixon

Is there any simple way of forcing load and JIT of assemblies? In my NUnit
tests timing information is skewed because of assembly load and JIT time the
first time each assembly is used, and I'd like a simple way of making sure
all the assemblies are pre-loaded and JITted if possible.
 
message | Is there any simple way of forcing load and JIT of assemblies? In my NUnit
| tests timing information is skewed because of assembly load and JIT time
the
| first time each assembly is used, and I'd like a simple way of making sure
| all the assemblies are pre-loaded and JITted if possible.
|
|
|

Assemblies aren't JIT compiled when loaded, methods are JIT compiled at
first call, so you need to execute each of them first before you can assume
they are compiled. Not sure why you are combining NUnit test with
instrumenting.

Willy.
 
Assemblies aren't JIT compiled when loaded, methods are JIT compiled at
first call

Yes I know that, which is why I said load *AND* JIT (JITting of all methods
being implicit in my question if not explicit).
Not sure why you are combining NUnit test with
instrumenting.

I was just getting a quick and dirty estimate of timings of certain
operations using exisiting NUnit tests. It's not "instrumenting". It's not
at all important in my scenario but it got me thinking about the more
general case of how you would factor out time taken to load/JIT where you
were trying to do accurate timings. I don't know anything about performance
counters for example and whether they can account for this (the MSDN, and
other for that matter, documentation on the subject is rather opaque IMO and
there seems to be no really simple cut-'n'-paste "this is how to use
performance counters in a piece of code to do function timings" examples to
get you started as far as I can find).
 
Back
Top