How to find out what optimizations the JVM applied to my code?

后端 未结 4 910
谎友^
谎友^ 2021-02-08 14:26

The JVM (especially the HotSpot VM) is famous for having a huge number of optimizations it can apply at runtime.

Is there a way to look at a certain piece of code and se

4条回答
  •  滥情空心
    2021-02-08 15:19

    Here is a good page on HotSpot optimizations. Some of the optimizations can be seen by looking at the bytecode emitted by the compiler. Other optimizations are dynamic and only exist during run-time. For example, HotSpot can do on-stack replacement which modifies the stack directly during runtime.

提交回复
热议问题