5 ms·
Java typically elides most allocations in hot loops where objects don't escape.
by saagarjha 3y ago
Java typically elides most allocations in hot loops where objects don't escape.
- pjmlp 3y agoYes and no, the effectivness depends on which JVM we are talking about. GraalVM does it much better than OpenJDK, then there are OpenJ9, PTC, Aicas, Azul, ART (yeah not really, but close enough), microEJ, and a couple of nameless others from Ricoh, Xerox, Cisco, Gemalto,... on their devices. Even if we stick to OpenJDK, the distributions based on it aren't all the same, for example Microsoft's fork has additional JIT improvements (-XX:+ReduceAllocationMerges).