By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,815 Members | 1,142 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,815 IT Pros & Developers. It's quick & easy.

lag time reading new code?

P: n/a
I've noticed that the first time code is called, it seemed to take a
noticably longer amount of time. Is this because the code isn't loaded
until the first time it is needed? If so, is there a way to force
modules or classes to be read at startup to avoid the lag later when
they are first needed?
Nov 21 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Methods are indeed compiled from MSIL the first time they are called -
this is why it is named a "just-in-time" compiler. It is also possible
to use the ngen.exe tool to precompile your MSIL into native code. This
may reduce execution time, although you lose out on optimizations that
may only be possible when the runtime condition is known. This may or
may not be significant - I would recommend you profile applications
before and after using the ngen tool on them and see how it goes.

There are usually ways to ngen code during the installation process on
a user's machine - if you wish to do this, check your setup
documentation for this feature.

Nov 21 '05 #2

P: n/a
there is a cofiguration option in 2.0 that address this at install time
and allows you to specify native image generation then (i.e. during the
install)

<assembly:NGen(NGenHint.Eager)>

Nov 21 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.