how to disable inlining optimization with sun jvm?

我只是一个虾纸丫 提交于 2019-12-22 05:47:09

问题


I need to do some experiments showing the effect of inlining on my code. Anybody knows how to disable inlining with sun jvm? I searched http://www.oracle.com/technetwork/java/javase/tech/vmoptions-jsp-140102.html and got to know -XX:InlineSmallCode=n can control the threshold of the inlining candidates. So will -xx:InlineSmallCode=0 work?


回答1:


I would try -XX:MaxInlineSize=0 instead. The description for InlineSmallCode seems a bit unclear as to whether or not it applies to all inlinings. You might also find this blog post helpful as it explains how to tell the JIT compiler to print information about which methods are being inlined:

Java 7: How to write really fast Java code

I think there might still be one exception where you can't disable inlining, and that's for completely empty methods (since the inlined method size would still be 0).



来源:https://stackoverflow.com/questions/15328971/how-to-disable-inlining-optimization-with-sun-jvm

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!