Is stack-based instruction set one of the most important factors affect java's performance? [closed]

StackOverflow https://stackoverflow.com//questions/21043435

  •  21-12-2019
  •  | 
  •  

Question

We know java adopts stack-based instruction set in case of enhencing its compatibility,but stack operation is much slower than register operation,so is it a important factor degrades the performance of java?I learned that java some times also uses registers to accelerate its excution speed,but I don't know how and when does java utilizes registers. Thank you!

Was it helpful?

Solution

The Java bytecode model has very little to do with the actual code being executed in a running application. HotSpot, as well as all other major JVMs, compiles the bytecode into native code using all applicable optimizations.

There is no performance impact of the bytecode's stack-based model on the performance of modern JVMs.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top