Skip to main content

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

Filter by
Sorted by
Tagged with
6 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 ...
AIWalker's user avatar
  • 1,317
1 vote
3 answers

Why do we oppose AOT and JIT compilation. Can they be complementary?

I'm just not sure as to why JIT (Just-in-time) and AOT (Ahead-of-time) are often presented in contradiction to another. If we do not care about about portability, it feels to me that a program could ...
jeremie's user avatar
  • 153
2 votes
3 answers

What EXACTLY can the Java JIT do?

Is there any documentation that exhaustively lists the optimizations that the Java JIT can make? I can easily find articles with examples of what the JIT can do, but I want to make sure that it's not ...
Andrew Rueckert's user avatar
0 votes
1 answer

Do JITs typically have their own internal assembler, use a library, or use an executable assembler?

Amongst the successful and widely used JITs out there (e.g. JVM JITs, JavaScript JITs, LuaJIT), is there a strong consensus on how the JIT compiler should interface with an assembler? The plausible ...
Praxeolitic's user avatar
  • 1,654
0 votes
0 answers

How to manage dynamically generated variables in Assembly

Along the lines of How v8 JIT compiler manages dynamically changing variables, wondering how you would go about creating dynamically generated variables in assembly. Not necessarily looking for ...
Lance's user avatar
  • 2,615
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 ...
Jay's user avatar
  • 141
0 votes
1 answer

Comparison of modern browsers' javascript engine JITs

I understands that most of the recent browsers use JIT compilation to execute javascript. What I do not understand is: which part of javascript is JIT'ed - the script, or the bytecode? Let me explain....
Kraken's user avatar
  • 111
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 ...
MathuSum Mut's user avatar
2 votes
2 answers

JIT based on precompiled code templates

This is a crazy idea that I just came up with, and I'm interested in knowing if it would be workable, or if someone already wrote about or implemented it. Imagine you are on a platform (a game ...
jdm's user avatar
  • 612
2 votes
1 answer

Can JIT compilation be non-deterministic?

I have been profiling a lot of javascript today in writing a firefox js engine bug report, and started really noticing the slight differences between JIT compilations. While there are some obvious ...
Burdock's user avatar
  • 203
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 ...
b0yfriend's user avatar
  • 669
2 votes
2 answers

What should JITed bytecode do exactly?

I'm working on a VM (and a scripting language for it) that I plan to implement JITing for. I'm only working on the "plumbing" of it now, but I don't want the JIT compiler to be an afterthought. ...
Famand's user avatar
  • 21
4 votes
1 answer

Do java .class files have a lexer/parser?

I've been learning ANTLR, by writing my own (extremely simple!) programming language It made me curious about how the lexer/parser/AST is implemented for java. Obviously there is a grammar for .java ...
phatmanace's user avatar
  • 2,475
3 votes
0 answers

Does loop unrolling on a JIT platfrom (.NET or JVM) provide any benefit

I know in C, you can use loop unrolling (unwinding) to help reduce branching in your code but at the expense of program size. That seems to work when you compile to a target machine, however, does it ...
Jetti's user avatar
  • 5,163
5 votes
1 answer

How do hybrid interpreter-JIT compilers work?

Chrome's V8 compiler, the Java HotSpot compiler, and many more have multiple tiers of interpretation and compilation. A function starts off as interpreted in HotSpot and then, if it is run often ...
Colorfully Monochrome's user avatar
0 votes
0 answers

Android runtime - does ART miss optimization opportunities over Dalvik?

Is ART a strict improvement over Dalvik, or there are optimizations that an ahead-of-time compiler will miss compared to JIT, but Google decide they don't matter in practice? For example, with JIT, ...
Phil's user avatar
  • 552
6 votes
1 answer

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

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 ...
Mitch Lindgren's user avatar
4 votes
3 answers

Which components/phases of a JIT compiler are different from a traditional ahead of time compiler?

Besides a faster register allocation algorithm and some trade-off in control and data-flow analysis for optimization purposes, which components/phases of a JIT compiler are different from a ...
Matthias's user avatar
  • 169
-1 votes
2 answers

How does the Common Language Runtime improve performance? [duplicate]

I read on the wikipedia article for Common Language Runtime that one of the benefits that the runtime provides is "Performance improvements". Executing managed code (Or bytecode) must surely always ...
neelsg's user avatar
  • 483
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 ...
Siler's user avatar
  • 421
171 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 ...
Aviv Cohn's user avatar
  • 21.4k
3 votes
0 answers

How can I find the start of a native method?

For a hobby project, I'm writing an x86 GC and JIT. For the GC, I need to maintain information about the stack layout (it's a precise GC), for which I need to be able to find out which method the IP ...
Pieter van Ginkel's user avatar
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 ...
Gomi's user avatar
  • 332
-1 votes
1 answer

Does Jar file shrinker affect performance [closed]

I've heard ProGuard's Jar shrinker affects the performance of you application. Is this true? And if so just how much slower does the Jar go shrinked compared to unshrinked?
user1870398's user avatar
3 votes
1 answer

Expensive AOT Optimizations

I've seen it stated several times that AOT can run some more expensive optimizations that take too long to be used by a JIT. But I've never seen it stated what exactly these optimizations are. So I'm ...
Winston Ewert's user avatar
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 ...
William Wong's user avatar
120 votes
11 answers

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

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 ...
Anonymous's user avatar
  • 3,556
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.
Sandeep Bansal's user avatar
4 votes
4 answers

Java/C# - When should AOT be considered if reverse engineering is a concern?

Long and short is really in the question title. For a language which compiles to an intermediate language like MSIL or Java byte-code, if there's concern about something like reverse engineering or ...
trycatch's user avatar
  • 1,100
34 votes
4 answers

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

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, ...
Saeed Neamati's user avatar
9 votes
1 answer

Pros and cons of JIT and AOT [closed]

In which respects "Just In Time" compilation is better than "Ahead Of Time" compilation? And vice versa.
Gulshan's user avatar
  • 9,462
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.) ...
Ebrahim Mohammadi's user avatar
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 ...
Armand's user avatar
  • 6,528