• Advertisement
Sign in to follow this  

[.net] JIT Compiler

This topic is 4572 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Is there is any way for my program to tell the .Net JIT to finish compiling the entire app? I know that the JIT compiles a function when the function is first called, but this can cause a slightly noticable delay on old computers when suddenly a lot of new code is executed (certain actions that do not load any resources but still produce a small delay when they are first performed). What I'd like to do is get all of the compiling done on the initial lode, so that these slight delays do not happen. Any way to do this? Thanks. - Fuzz

Share this post


Link to post
Share on other sites
Advertisement
Note that using NGen will not speed up your app, in most case it will slow it down. JIT makes a lot of optimizations, by using Ngen you loose most of them.

Share this post


Link to post
Share on other sites
Thanks for the info.

It is my understanding after reading the articles Promit linked that NGen is run on the client computer (say during installation) and invokes the JIT, which performs all optimizations for that computer's architecture. Is this understanding correct?

The problem with NGen is that it's a little inconvenient. Either the user would have to run it on my program or the installer would (which isn't a big deal, but I'd have to figure out how to do it).

So there isn't any API or anything that I can call which tells the JIT to finish compiling?

Thanks!

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
There are tons of information why you shouldn't do what you're asking for, and why you shouldn't use NGen. Solve your problems in another way. What exact code paths are causing the problem? Make sure to call that code during startup instead to avoid that problems.

Share this post


Link to post
Share on other sites
On low-end machines, there is a small (< second) delay when the first order is given to a unit, which executes code such as pathfinding, AI, logic, etc... After that, no delay at all. Calling this code during startup sounds like a hack, not to mention impossible or at least extremely impracticle.

Share this post


Link to post
Share on other sites
It's much less of a hack than using something like NGen. You could easily do some of these calls, by making the first unit you create move to the block he is currently standing in, or some similar 'dummy' move. You should be able to call this 'hack' right after your loading, just before your game loop begins.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement