3 ms·
Short answer: not necessarily A good JVM contains optimizations, which makes it cheap. For example, it will try to allocate the object on the stack instead of
by qznc 15y ago
Short answer: not necessarily
A good JVM contains optimizations, which makes it cheap. For example, it will try to allocate the object on the stack instead of the heap. Apart from field initialization, this costs nothing, because the stack pointer probably had to be changed anyways.