Questions tagged [jit]

The JIT (just-in-time compilation) is a method to improve the run-time performance of computer programs based on byte code (virtual machine code).

33 questions
168
votes
1 answer

Understanding the differences: traditional interpreter, JIT compiler, JIT interpreter and AOT compiler

I'm trying to understand the differences between a traditional interpreter, a JIT compiler, a JIT interpreter and an AOT compiler. An interpreter is just a machine (virtual or physical) that executes instructions in some computer language. In that…
Aviv Cohn
  • 21,190
  • 31
  • 118
  • 178
119
votes
11 answers

What backs up the claim that C++ can be faster than a JVM or CLR with JIT?

A reoccurring theme on SE I've noticed in many questions is the ongoing argument that C++ is faster and/or more efficient than higher level languages like Java. The counter-argument is that modern JVM or CLR can be just as efficient thanks to JIT…
Anonymous
  • 3,546
  • 2
  • 25
  • 26
41
votes
5 answers

JIT compiler for C, C++, and the likes

Is there any just-in-time compiler out there for compiled languages, such as C and C++? (The first names that come to mind are Clang and LLVM! But I don't think they currently support it.) Explanation: I think the software could benefit from runtime…
Ebrahim Mohammadi
  • 549
  • 1
  • 4
  • 7
33
votes
4 answers

Why after each restart, my local .NET sites take time to load for the first time?

I'm developing sites based on .NET platform. I usually deploy these sites on my local IIS, so that I can test them and see their functionality before going live. However, each time I restart windows, it seems that sites take a long time to run for…
Saeed Neamati
  • 18,142
  • 23
  • 87
  • 125
24
votes
4 answers

How does Chrome V8 work? And why was JavaScript not JIT-Compiled in the first place?

I have been researching Interpreters/Compilers, then I stumbled across JIT-Compilation - specifically Google Chrome's V8 Javascript Engine. My questions are - How can it be faster than standard Interpretation? Why wasn't JIT-Compilation used in the…
b0yfriend
  • 669
  • 2
  • 6
  • 9
13
votes
3 answers

Why hasn't Python been optimized like modern Javascript implementations?

Modern Javascript implementations like V8 (Chrome), SpiderMonkey (Firefox), and Chakra (IE/Edge) all have JIT compilation, and a number of other optimizations to improve performance. Why doesn't Python have these? I have been looking at PyPy and…
Jay
  • 141
  • 1
  • 4
12
votes
1 answer

What's the relationship between meta-circular interpreters, virtual machines and increased performance?

I've read about meta-circular interpreters on the web (including SICP) and I've looked into the code of some implementations (such as PyPy and Narcissus). I've read quite a bit about two languages which made great use of metacircular evaluation,…
Gomi
  • 332
  • 1
  • 4
10
votes
1 answer

Machine code JITs and the Execution Disable bit

How is runtime-generated machine-code (such as the output of a JIT), actually executed by the CPU if the CPU/OS has an Execution Disable bit? As far as I know, many modern processors and Operating Systems include support for an NX bit, (including…
Siler
  • 421
  • 3
  • 11
9
votes
1 answer

Pros and cons of JIT and AOT

In which respects "Just In Time" compilation is better than "Ahead Of Time" compilation? And vice versa.
Gulshan
  • 9,402
  • 10
  • 58
  • 89
9
votes
13 answers

Would a statically typed alternative to JavaScript on webpages be practical?

Preference for dynamic and static typing is largely a matter of taste, and different people find them more or less suitable in different situations. My question is, would it be technically possible to have a statically-typed alternative to…
Armand
  • 6,508
  • 4
  • 37
  • 53
8
votes
2 answers

Does current JIT optimize generated machine codes for branch prediction based on runtime statistics?

Some JVMs would compile Java byte code into native machine code. We know that there are lots of optimizations we could apply for that. Recently, I also learn that a branch operation may block the CPU and affect the performance significantly, if a…
William Wong
  • 183
  • 4
7
votes
5 answers

Why is it called Just In Time?

I know what the JIT compiler is but how about why is it called that, it obviously catches exceptions Just in Time, but how and why should it be called this? Sorry if this sounds a bit vague.
6
votes
2 answers

How do JIT interpreters handle variable names?

Let's say I am to design a JIT interpreter that translates IL or bytecode to executable instructions at runtime. Every time a variable name is encountered in the code, the JIT interpreter has to translate that into the respective memory address,…
MathuSum Mut
  • 219
  • 1
  • 7
6
votes
1 answer

Why is Android Runtime's AOT compilation more performant than Dalvik's JIT?

With Android 5.0, Google has introduced the Android Runtime, or ART. ART "brings improvements in performance, garbage collection, applications debugging and profiling." However, it also replaces Dalvik's Just-in-Time compilation with Ahead-of-Time…
Mitch Lindgren
  • 454
  • 3
  • 10
5
votes
3 answers

How does a JIT compiler actually emit and then call the emitted native code?

Assuming that a VM runs a JIT compiler on otherwise "interpreted" code, such as a line by line interpreter or some form of bytecode/IL code and determines that it can create optimised native code for some part of what is running, what mechanism is…
AIWalker
  • 1,287
  • 5
  • 15
1
2 3