Skip to main content
OverflowAI is here! AI power for your Stack Overflow for Teams knowledge community. Learn more
23 votes

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

Why doesn't Python have these? I'm not sure why you think there are no Python implementations that care about performance. PyPy, IronPython, and Jython are all industrial-strength, production-ready ...
Jörg W Mittag's user avatar
9 votes
Accepted

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

If I was writing a normal compiler, I couldsimply write the desired binary to a file, to be run later by the system in whatever manner it usually would be, but how would a JIT compiler do that during ...
Jörg W Mittag's user avatar
7 votes

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 ...
el.pescado - нет войне's user avatar
7 votes
Accepted

How do JIT interpreters handle variable names?

Have a look at this example from Wikipedia: for (int i = 2; i < 1000; i++) { for (int j = 2; j < i; j++) { if (i % j == 0) continue outer; } System.out.println (...
Robert Harvey's user avatar
7 votes
Accepted

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

You're talking about profile-guided optimization. The Scala native AOT compilers I've seen employ PGO do so in two stages. Basically, the first pass instruments the code to generate a profile file ...
Karl Bielefeldt's user avatar
6 votes
Accepted

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

"there is no widely accepted best approach and all of these approaches are used by major JITs" There is no widely accepted best approach and all of these approaches are used by major JITs. ...
Jörg W Mittag's user avatar
5 votes

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

JITs are fast for JavaScript, because it's impossible to generate fast machine code when you do not know the type of your variables. When you do not have type information, computations are expensive. ...
user835611's user avatar
4 votes

How do JIT interpreters handle variable names?

Variables are mostly known at parsing time and their binding and scope is relevant for parsing. JIT compiling libraries don't really handle variables (and don't care much about their name, type and ...
Basile Starynkevitch's user avatar
3 votes
Accepted

What EXACTLY can the Java JIT do?

No, there no upper bound on the optimizations a JVM is allowed to perform. Therefore, it is not fundamentally possible to prevent optimizations. Instead, strongly prefer using functions from the Java ...
amon's user avatar
  • 134k
2 votes

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

You seem to be missing a critical aspect of JIT: platform independence. As soon as you compile down to machine code AOT, your program isn't platform-independent anymore. That said, the .NET ...
Robert Harvey's user avatar
2 votes

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

The reality on a modern operating system is that you can't just run any compiled code, you need the operating system to give you permission for that. For example, on MacOS getting that permission will ...
gnasher729's user avatar
  • 45.7k
2 votes

What EXACTLY can the Java JIT do?

No conforming JVM can perform an optimization that would cause the order of side effects as specified in the language definition to change. Any other optimization is available to it. In your ...
Jules's user avatar
  • 17.8k
1 vote

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

Yes. It's possible and quite common for a program to be recompiled three times: At the developer's machine, the code is compiled to an intermediate language code. This is a form of the code that's ...
Lie Ryan's user avatar
  • 12.4k
1 vote

What EXACTLY can the Java JIT do?

You are doing it with needless complexity. Firstly, you have a complex SQL query, which should be avoided. Your business logic should not be written in SQL. I would use SQL just for queries and ...
juhist's user avatar
  • 2,579

Only top scored, non community-wiki answers of a minimum length are eligible