Why is it hard to beat AOT compiler with a JIT compiler (in terms of app. performance)?

There’s a definite trade-off between JIT and AOT (ahead-of-time) compilation. As you stated, JIT has access to run-time information that can aid in optimization. This includes data about the machine it’s executing on, enabling platform-specific native optimization. However, JIT also has the overhead of translating byte-code to native instructions. This overhead often becomes apparent in … Read more

Is it true that having lots of small methods helps the JIT compiler optimize?

The Hotspot JIT only inlines methods that are less than a certain (configurable) size. So using smaller methods allows more inlining, which is good. See the various inlining options on this page. EDIT To elaborate a little: if a method is small it will get inlined so there is little chance to get penalised for … Read more

java PrintCompilation output: what’s the meaning of “made not entrant” and “made zombie”

I’ve pulled together some info on this on my blog. A Cliff Click comment I found says: Zombie methods are methods whose code has been made invalid by class loading. Generally the server compiler makes aggressive inlining decisions of non-final methods. As long as the inlined method is never overridden the code is correct. When … Read more

What are the differences between a Just-in-Time-Compiler and an Interpreter?

I’ve always found that a more abstract explanation sometimes helps. Let’s say that you are trying to ask everyone in Mexico “Hello. How are you?” (your source language) Of course, you’ll first need to translate it to Spanish (the native language of the country). That translation would be “Hola. Como estas?” If you know Spanish, … Read more

JIT not optimizing loop that involves Integer.MAX_VALUE

I have not dug up the Java Language Specification, but I’d guess that it has to do with this difference: i++ < (Integer.MAX_VALUE – 1) never overflows. Once i reaches Integer.MAX_VALUE – 1 it is incremented to Integer.MAX_VALUE and then the loop terminates. i++ < Integer.MAX_VALUE contains an integer overflow. Once i reaches Integer.MAX_VALUE, it … Read more

Where is the .NET JIT-compiled code cached?

Memory. It can be cached, that’s the job of ngen.exe. It generates a .ni.dll version of the assembly, containing machine code and stored in the GAC. Which automatically gets loaded afterward, bypassing the JIT step. But that has little to do with why your program starts faster the 2nd time. The 1st time you have … Read more

Is there a runtime benefit to using const local variables?

The generated IL is different (using Release mode): using constant local using normal local ——————————————————————— .entrypoint .entrypoint .maxstack 2 .maxstack 2 .locals init ( .locals init ( [0] int32 i) [0] int32 timesToLoop, L_0000: ldc.i4.0 [1] int32 i) L_0001: stloc.0 L_0000: ldc.i4.s 50 L_0002: br.s L_0008 L_0002: stloc.0 L_0004: ldloc.0 L_0003: ldc.i4.0 L_0005: ldc.i4.1 L_0004: … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)