Q.) What is IL Code?
A.) Partially Compiled code or half compiled code.
Q.) Why is It half compiled and not fully compiled?
A.) When we compile our CODE (OS, hardware, config) compiler who converts the source code into the machine language.
When he compiles our code he takes various parameters like OS,hardware, config files.
Let us consider the code which is compiled in windows 7 and as per the situation the properties is taken like (OS, hardware, config) and optimal code is compiled as per that environment. Now if we try to run the same application on windows 8 then it will run but it will not optimally run means the required performance benefits as compare to windows 7.
So in .NET it compiles the code and converts the code into half compiled format called as IL code. And at Run time one more entity called as JIT compiler. So the JIT comes and takes all the parameters like (OS, hardware, config) and depends on these properties and compiles the optimal code for the same movement.
So at the Run time compiler can figure out what are the parameters and compile the Optimal code as per the environment.
Q.) Who compiles the IL Code to Machine Language and how?
A.) JIT
How : 1) Per File , 2) Per Method / Function , 3) Code Fragment and all the 3 ways are dependent on JIT which is not controlled from outside.
Q.) What are Types of JIT ?
A.) 3 Types :
a) Normal JIT : Dynamically requires Method and Stored in Memory (RAM).
b) Econo JIT : Dynamically and not stored in memory.
c) Pre-JIT : Full Compilation(Ngen.exe).Native Image Generator.
Q.) How can i force my compilation to Ecnon or Normal JIT?
A.) We cannot.It is internal. If the memory is more then Normal JIT may work and if the memory is low then the Econo JIT will work. CPU power is higher then Normal JIT is Used.
A.) Partially Compiled code or half compiled code.
Q.) Why is It half compiled and not fully compiled?
A.) When we compile our CODE (OS, hardware, config) compiler who converts the source code into the machine language.
When he compiles our code he takes various parameters like OS,hardware, config files.
Let us consider the code which is compiled in windows 7 and as per the situation the properties is taken like (OS, hardware, config) and optimal code is compiled as per that environment. Now if we try to run the same application on windows 8 then it will run but it will not optimally run means the required performance benefits as compare to windows 7.
So in .NET it compiles the code and converts the code into half compiled format called as IL code. And at Run time one more entity called as JIT compiler. So the JIT comes and takes all the parameters like (OS, hardware, config) and depends on these properties and compiles the optimal code for the same movement.
So at the Run time compiler can figure out what are the parameters and compile the Optimal code as per the environment.
Q.) Who compiles the IL Code to Machine Language and how?
A.) JIT
How : 1) Per File , 2) Per Method / Function , 3) Code Fragment and all the 3 ways are dependent on JIT which is not controlled from outside.
Q.) What are Types of JIT ?
A.) 3 Types :
a) Normal JIT : Dynamically requires Method and Stored in Memory (RAM).
b) Econo JIT : Dynamically and not stored in memory.
c) Pre-JIT : Full Compilation(Ngen.exe).Native Image Generator.
Q.) How can i force my compilation to Ecnon or Normal JIT?
A.) We cannot.It is internal. If the memory is more then Normal JIT may work and if the memory is low then the Econo JIT will work. CPU power is higher then Normal JIT is Used.
0 comments:
Post a Comment