Why is the JVM slow to start?

后端 未结 8 1810
耶瑟儿~
耶瑟儿~ 2020-12-13 12:42

What exactly makes the JVM (in particular, Sun\'s implementation) slow to get running compared to other runtimes like CPython? My impression was that it mainly has to do wit

8条回答
  •  遥遥无期
    2020-12-13 13:21

    In addition to things already mentioned (loading classes, esp. from compressed JARs); running in interpreted mode before HotSpot compiles commonly-used bytecode; and HotSpot compilation overhead, there is also quite a bit of one-time initialization done by JDK classes themselves. Many optimizations are done in favor of longer-running systems where startup speed is less of a concern.

    And as to unix style pipelining: you certainly do NOT want to start and re-start JVM multiple times. That is not going to be efficient. Rather chaining of tools should happen within JVM. This can not be easily intermixed with non-Java Unix tools, except by starting such tools from within JVM.

提交回复
热议问题