Over time, Sun\'s JVM and JIT have gotten pretty smart. Things that used to be common knowledge as being a necessary micro-optimization are no longer needed, because it gets ta
It's beyond impressive. All of these are things you can't
do in C++ (certainly to the same extent Java does). Keep in mind that early versions of Java started the "slow" reputation by not having these things, and we keep improving significantly over time. This is still a big research area.
Oracle has a wiki on Performance techniques used in the Hotspot JVM.
Java is smarter at inlining as it can