0

When i take some .net assembly and run it on machine => the JIT convert the code to native and run it. If i will stop the application and run it again it will load ( again ) into JIT and the JIT will convert it again and run it again.

So why is the second time of the application run will be more optimize and fester ? Does the JIT save somehow the first native code and then there is no need to convert the code again from the IL to native ? if its 'yes' so where the converted code ( the native ) is saved ?

Yanshof
  • 9,659
  • 21
  • 95
  • 195

1 Answers1

2

It's probably in memory. Pretty much the second time you do anything is faster as whatever you're doing is cached in various places through the system (by your disc, by the OS, ...).

When I say "it" I mean the full chain of files and libraries that are needed to make your .NET app run.

Andrew Barrett
  • 19,721
  • 4
  • 47
  • 52
  • and if i clean the cache ( assume the the cache is the ram ) ? the code of the native is cleaned up .. and its still suppose to run fester in the second time – Yanshof Feb 25 '12 at 13:12
  • 1
    When I say cache, I mean that in a very broad sense. Your disc controller will cache the files so that it doesn't load from the platter, the OS will cache the files so it doesn't need to go to disc, etc, etc. There is no way that you can effectively clean all the caches that will kick in. – Andrew Barrett Feb 25 '12 at 13:14
  • 1
    There is very little you can do on a computer that *isn't* faster a second time. – Andrew Barrett Feb 25 '12 at 13:15