JIT

M

Mike Peretz

For those of you coding windows Application under the framework you must
noticed that forms take a performance hit loading the first time. This is
because of JIT, I was able to fix this behavior by using ngen.exe, but then
I don't get the same optimization JIT gives me and it is a headache for
installations (negen has to be called right after the installation).



According to Microsoft, a function gets JIT to native code the first time it
is accessed. Is it possible to tell the framework to JIT certain functions
at runtime without actually calling the functions?



Basically, I would like to pre-JIT some of my functions so they don't
experience a performance hit the first time they are called.



Is this possible?
 
G

Gabriele G. Ponti

Mike,

Have you considered using NGEN.EXE? This utility creates a native image from
a managed assembly. You could put your functions in a separate DLL, and use
this utility to pre-JIT your code.

See the NGEN.EXE documentation in the .NET Framework SDK Documentation for
more details.

Gabriele
 
M

Mike Peretz

Yes I know about negen.exe

I rahter use JIT, it has better optimization - but I want to control JIT at
run time.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top