How can Java inline over virtual function boundaries?

前端 未结 3 890
轮回少年
轮回少年 2021-02-20 10:03

I\'m reading up some material on whether Java can be faster than C++, and came across the following quote:

Java can be faster than C++ because JITs can in

3条回答
  •  终归单人心
    2021-02-20 10:52

    Since compilation of Java bytecode into machine code is deferred until runtime, it is possible for JVMs to perform profile-guided optimization and other optimizations that require information not available until code is running. This may even include "deoptimization", where a previously made optimization is revoked so that other optimizations can occur.

    More information about this can be found under adaptive optimization on Wikipedia, which includes optimizations related to inlining.

提交回复
热议问题