Home All Groups Group Topic Archive Search About

Forcing JIT of assemblies

Author
26 Jan 2006 11:27 AM
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.

Author
26 Jan 2006 12:58 PM
Willy Denoyette [MVP]
"Clive Dixon" <clived.noluncheonm***@digita.noluncheonmeat.com> wrote in
message news:eKOe9tmIGHA.2668@tk2msftngp13.phx.gbl...
| 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.
Author
27 Jan 2006 9:36 AM
Clive Dixon
>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).

Show quote
"Willy Denoyette [MVP]" <willy.denoye***@telenet.be> wrote in message
news:OOKT3gnIGHA.3856@TK2MSFTNGP12.phx.gbl...
>
> "Clive Dixon" <clived.noluncheonm***@digita.noluncheonmeat.com> wrote in
> message news:eKOe9tmIGHA.2668@tk2msftngp13.phx.gbl...
> | 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.
>
>
>
>
Author
27 Jan 2006 3:10 PM
Vadym Stetsyak
You can try procompile assemblies with NGEN tool

--
Vadym Stetsyak aka Vadmyst
http://vadmyst.blogspot.com

Show quote
"Clive Dixon" <clived.noluncheonm***@digita.noluncheonmeat.com> wrote in
message news:ecvQoUyIGHA.3816@TK2MSFTNGP12.phx.gbl...
> >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).
>
> "Willy Denoyette [MVP]" <willy.denoye***@telenet.be> wrote in message
> news:OOKT3gnIGHA.3856@TK2MSFTNGP12.phx.gbl...
>>
>> "Clive Dixon" <clived.noluncheonm***@digita.noluncheonmeat.com> wrote in
>> message news:eKOe9tmIGHA.2668@tk2msftngp13.phx.gbl...
>> | 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.
>>
>>
>>
>>
>
>

AddThis Social Bookmark Button