Overhead: method invocation versus object creation
As far as I understand the JVM, it is generally cheaper to call a method (i.e. allocate a new stack stack, etc.) than to create a new object.
However, can we estimate how big the difference between the overhead is between them in general, assuming that both the method and the object declare the same number of local / instance variables of the same type and create them for the same values
+3
source to share
2 answers