Smart JVM and JIT Micro-Optimizations

前端 未结 3 1912
你的背包
你的背包 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:33

    It's beyond impressive. All of these are things you can't do in C++ (certainly to the same extent Java does). Keep in mind that early versions of Java started the "slow" reputation by not having these things, and we keep improving significantly over time. This is still a big research area.

    • Efficient interface dispatch.
    • Inlining and direct dispatch of virtual method calls.
    • Very fast object allocation with bump pointers (slide 19 or so) and escape analysis.

提交回复
热议问题