clr and jit

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
 
M

Michael Nemtsev [MVP]

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>
 
J

Jon Skeet [C# MVP]

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).
 
B

Ben Voigt [C++ MVP]

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.
 
A

Andrei Varanovich [C# MVP]

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
 
J

Jon Skeet [C# MVP]

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top