有没有办法关闭JIT编译器,这样做是否会对性能产生影响? [英] IS there a way to turn off JIT compiler and is there a performance impact by doing so?
本文介绍了有没有办法关闭JIT编译器,这样做是否会对性能产生影响?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
将Java程序进行JIT处理是什么意思?它会使执行速度提高很多吗?还是存在不是JIT处理的字节码?
What does it mean for a java program to be JIT'ed and does it make the execution a lot more faster or are there bytecodes which are not JIT'ed?
推荐答案
有两种方法可以禁用JIT
There is two ways to disable the JIT
-Djava.compiler=NONE
否则这几乎永远不会编译任何东西
or this will almost never compile anything
-XX:CompileThreshold=2000000000
或在IBM JVM上
-nojit
禁用JIT可能会使您的代码变慢很多,例如50倍,但并非总是如此.如果您花费大部分时间进行IO或GUI更新,则可能会发现它们没有什么区别.
Disabling the JIT can slow down your code a lot e.g. 50x but not always. If you spend most of your time doing IO or GUI updates you might find it makes little difference.
这篇关于有没有办法关闭JIT编译器,这样做是否会对性能产生影响?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文