Smart JVM and JIT Micro-Optimizations

前端 未结 3 1857
你的背包
你的背包 2021-02-06 11:20

Over time, Sun\'s JVM and JIT have gotten pretty smart. Things that used to be common knowledge as being a necessary micro-optimization are no longer needed, because it gets ta

3条回答
  •  一生所求
    2021-02-06 11:48

    Java is smarter at inlining as it can

    • inline code only available at runtime or even dynamically generated.
    • inline virtual methods (up to two at once)
    • perform escape analysis on inlined methods and the methods they were inlined to. (Much harder to do in C++)

提交回复
热议问题