Skip to content
Advertisement

Tag: jit

Is JVM or JIT able to reduce duplicate method calls?

I have a function that checks if a map has some value for key (map.get(key) != null) and then returns the value, or else create new value. I’m wondering is there any JVM or JIT magic that doesn’t have to do 2 map lookups when the value exists for the given key? According to my benchmark, it seems no optimisation

Minor question about Segmented Code Cache (http://openjdk.java.net/jeps/197)

I see that this JEP (http://openjdk.java.net/jeps/197) introduced 3 types of code caches. The most obvious one to me is -XX:NonNMethodCodeHeapSize. This is the one that deals with JVM internal data. What I do not understand is what is the difference between NonProfiledCodeHeapSize and ProfiledCodeHeapSize. That document says that: Tiered compilation also introduces a new compiled code type: instrumented compiled code

Why is Java faster when using a JIT vs. compiling to machine code?

I have heard that Java must use a JIT to be fast. This makes perfect sense when comparing to interpretation, but why can’t someone make an ahead-of-time compiler that generates fast Java code? I know about gcj, but I don’t think its output is typically faster than Hotspot for example. Are there things about the language that make this difficult?

Advertisement