none
After compiling IL code - where the compiled code is stored ? RRS feed

  • Question

  • In case some application  ( assembly )  is copy from one machine to other machine -   and the user is double click on the application exe file ( for the first time ). The IL code will compile by the JIT compiler and the compiled code will be stored on the machine.

     

    My Question is .... where the compiled code will be stored ?

     

    Sunday, June 20, 2010 10:43 PM

Answers

  • in RAM its not done just once, its done every time unless you pre-jit the assembly using NGEN then it ends up somewhere on the harddrive.

    • Marked as answer by eryang Friday, July 2, 2010 3:08 AM
    Monday, June 21, 2010 12:02 AM
  • Jitted code never gets saved to disk. The only thing you know for sure is that a method is only jitted once per per process. Anytime you start the application (either, on the same machine or another machine that never ran that same program) all the methods that need to be pre-compiled will continue to need that same pre-compilation.

    That said, it means that the time difference you're looking at is due to some other reason. Maybe some log files being created on the disk, some data structure initialization or something else completely different. Just not anything about the JIT-compiler.


    -- Blog: http://geeklyeverafter.blogspot.com/
    • Marked as answer by eryang Friday, July 2, 2010 3:08 AM
    Monday, June 21, 2010 10:38 AM

All replies

  • in RAM its not done just once, its done every time unless you pre-jit the assembly using NGEN then it ends up somewhere on the harddrive.

    • Marked as answer by eryang Friday, July 2, 2010 3:08 AM
    Monday, June 21, 2010 12:02 AM
  • i understand that this is in the RAM -

    but in case the process of the assembly is not running ( not loaded ) then the compiled code need to be store on the local disk. I want to know where it is stored on the disk ... ( is in on the same place that the exe file is exist ?  is it with the metadata ? )

    Monday, June 21, 2010 6:38 AM
  • The native code generated by the JIT compiler is not stored on the disk.
    Monday, June 21, 2010 8:39 AM
  •  

    At the beginning, our managed methods are compiled into IL instructions and store in .exe or .dll files; then, if we launch the .exe file by double-clicking, when a method (consisted by IL instructions) is going to be executed, JIT will compile the method into native binary instructions, and store the native instructions in memory, not on disk.


    Sincerely,
    Eric
    MSDN Subscriber Support in Forum
    If you have any feedback of our support, please contact msdnmg@microsoft.com.
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    Monday, June 21, 2010 9:10 AM
  • OK ,

     

    But in this case  -  if i will copy the exe file ( assembly ) to some other machine - then how the .net framework will know that the il code need to re-compile to current machine ? ( to the current hardware ) ?

    Monday, June 21, 2010 9:43 AM
  • If its not store on the disk => then the JIT need to re-compile it any run - and its not what actuly happand.
    Monday, June 21, 2010 9:45 AM
  • Actually, if the managed process keeps running, JIT promises to compile each method only once, but, if we restart the process, all native binary instructions in memory are released (along with the exiting of previous process), and JIT need to compile IL instructions again. 
    Sincerely,
    Eric
    MSDN Subscriber Support in Forum
    If you have any feedback of our support, please contact msdnmg@microsoft.com.
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    Monday, June 21, 2010 10:17 AM
  • I see, but there is still something that i don't get it -

     

    If i run the assembly ( lets say exe ) first time => the time that will be take to the process to launch up will be more then if i will launch it on the second time.

    Now, In case i restart the machine - the launch time will be same as the second launch time => so the compiling occur only once => when i launch the assembly on the first time only ==> that mean that some compiled code is save on the local machine disk ...

     

    Did i understand correctly ? where am i wrong ?

    Monday, June 21, 2010 10:22 AM
  • Jitted code never gets saved to disk. The only thing you know for sure is that a method is only jitted once per per process. Anytime you start the application (either, on the same machine or another machine that never ran that same program) all the methods that need to be pre-compiled will continue to need that same pre-compilation.

    That said, it means that the time difference you're looking at is due to some other reason. Maybe some log files being created on the disk, some data structure initialization or something else completely different. Just not anything about the JIT-compiler.


    -- Blog: http://geeklyeverafter.blogspot.com/
    • Marked as answer by eryang Friday, July 2, 2010 3:08 AM
    Monday, June 21, 2010 10:38 AM
  •  

    Hi ronili2,

    I'm writing to check the issue status, please feel free to let us know if you have any concern.


    Sincerely,
    Eric
    MSDN Subscriber Support in Forum
    If you have any feedback of our support, please contact msdnmg@microsoft.com.
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    Friday, June 25, 2010 5:17 AM
  • the code will be recompiled whenever u run the application.

    the better performance in second time is not because of stored compiled code as you think.

     

    >Bineesh

    Friday, June 25, 2010 7:25 PM