clr and jit

  • Thread starter Thread starter Daniel
  • Start date Start date
D

Daniel

What is the difference in definition between clr and jit compiler? Does the
use of jit make .NET an interpreted language, or is it still a compiled
language, or both?

Daniel
 
Hello Daniel,

Read there

http://en.wikipedia.org/wiki/Just-in-time_compilation
http://en.wikipedia.org/wiki/Common_Language_Runtime

---
WBR,
Michael Nemtsev [.NET/C# MVP] :: blog: http://spaces.live.com/laflour

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo


D> What is the difference in definition between clr and jit compiler?
D> Does the use of jit make .NET an interpreted language, or is it still
D> a compiled language, or both?
D>
D> Daniel
D>
 
Daniel said:
What is the difference in definition between clr and jit compiler?

The JIT compiler is just one small part of the CLR.
Does the use of jit make .NET an interpreted language, or is it still
a compiled language, or both?

The code is never interpreted in .NET - always JIT compiled and then
executed natively (with support from the CLR, of course).
 
Jon Skeet said:
The JIT compiler is just one small part of the CLR.


The code is never interpreted in .NET - always JIT compiled and then
executed natively (with support from the CLR, of course).

Which occasionally is a performance-killing mistake.

For example, a type initializer. Is there ever an advantage to optimizing
the .cctor? Anything I can think of that could need optimization (anonymous
methods, expression trees, etc) has already been separated by the compiler
before any MSIL is generated.
 
Hello Ben,
Which occasionally is a performance-killing mistake.
For example, a type initializer. Is there ever an advantage to
optimizing the .cctor? Anything I can think of that could need
optimization (anonymous methods, expression trees, etc) has already
been separated by the compiler before any MSIL is generated.

If you care about performance -- use NGEN utility from .NET SDK. It produces
native code from your assebmly instead of IL.

Thanks,
Andre
 
Ben Voigt said:
Which occasionally is a performance-killing mistake.

For example, a type initializer. Is there ever an advantage to optimizing
the .cctor? Anything I can think of that could need optimization (anonymous
methods, expression trees, etc) has already been separated by the compiler
before any MSIL is generated.

Likewise the initialization code for most forms is often executed only
once. I believe that Sun's HotSpot JIT will interpret code the first
time it runs, unless it spots significant loops. The benefit of the
"always JIT, and JIT exactly once" solution is that it's much simpler
than the kind of optimisation HotSpot performs. But yes, there can be a
price to pay.
 
Back
Top