Blog entries in category "Java" shown here:
See other entries in category :
Whateveah | Java | All
20060409 Sunday April 09, 2006

CLR Native JIT'ing

As I mentioned earlier, the NGEN tool in the CLR can be used to force the JIT to compile the IL to native format. You can also use it directly on an exe. For example
C:\TEMP\TestApp\TestApp\bin\Release>ngen install TestApp.exe
Microsoft (R) CLR Native Image Generator - Version 2.0.50727.42
Copyright (C) Microsoft Corporation 1998-2002. All rights reserved.
Installing assembly C:\TEMP\TestApp\TestApp\bin\Release\TestApp.exe
Compiling 1 assembly:
    Compiling assembly C:\TEMP\TestApp\TestApp\bin\Release\TestApp.exe ...
TestApp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
This results in the native image of the executable being generated in the Native assembly cache and the file can be inspected here. (You need to do this from a DOS prompt as this dir may not show up in explorer)
C:\WINNT\assembly\NativeImages_v2.0.50727_32\TestApp\3d175dbade97d648b002a9881f995ca8>dir
Directory of C:\WINNT\assembly\NativeImages_v2.0.50727_32\TestApp\3d175dbade97d648b002a9881f995ca8
04/06/2006  08:12 PM              .
04/06/2006  08:12 PM              ..
04/06/2006  08:12 PM            13,824 TestApp.ni.exe
               1 File(s)         13,824 bytes
               2 Dir(s)     774,688,768 bytes free
To verify that the native image is indeed being used at runtime, you can use the Assembly Binding Log Viewer (Fuslogvw.exe) tool. Fire it up, change the settings and log location, start your app and hit refresh. Something like this will show up verifying that the native image is being used.
The general guideline seems to be that one should test out the performance for both native/non native images. Just because its native doesnt really mean it will perform better but you may be able to reduce the memory footprint,and share memory pages across applications. Theres some detail around this in an April 2005 MSDN mag article here.


( Apr 09 2006, 12:00:00 AM EDT ) Permalink Comments [0]
Trackback URL: http://blogs.sun.com/sameert/en/entry/testing_exe_jit_ing_in
Comments:

Post a Comment:

Name:
E-Mail:
URL:

Your Comment:

HTML Syntax: NOT allowed