Java Runtime Performance Vs Native C / C++ Code?

前端 未结 9 2309
隐瞒了意图╮
隐瞒了意图╮ 2020-12-12 14:10

I\'ve become more and more comfortable programming in Java than with C++ or C. I am hoping to get a sense of the performance hit incurred using a JVM interpreter, as oppose

9条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-12 14:29

    Actually, a VM can do a lot of optimizations at runtime, based on information that's only available at runtime, that a C/C++ compiler cannot do. So, in most circumstances, the JVM will be at least as fast as a native program.

    Brian Goetz answers most, if not all of your questions in his talk Towards a universal VM.

提交回复
热议问题