Hi Umeshnath,
Please consider the following code...
public static void main()
{
Console.writeline("First call to the writeline method");
Console.writeline("Second call to the writeline method");
}
When the call to writeline is made, the JITCompiler has to convert the
intermediate language (IL) into native code. The IL is stored in the
assembly's metadata that the code is contained in. The JITCompiler stores the
native code in a section of memory that has been dynamically allocated and
then redirects the call to Console.writeline to the newly created native
code.
When the second call to Console.writeline is made, the native code has
already been compiled and can be executed without the 'compile to native'
step.
This means that there is a slight performance hit the first time the call to
writeline is made but not the second time.
Since the JITCompiler stores the code in dynamically allocated memory, it is
thrown away when the application terminates. If you stop the application and
then re-run it, the code for writeline will have to be JITCompiled again as
explained previously.
Hope this helps,
wibberlet (development blog at
http://wibberlet.blogspot.com)
=================================================