gpt4 book ai didi

java - 观察 JIT 的结果

转载 作者:塔克拉玛干 更新时间:2023-11-02 19:28:39 26 4
gpt4 key购买 nike

有没有办法在适当预热后可视化特定函数的 JIT 结果?例如,我想看看 JIT 是否优化了对 java.nio 缓冲区访问器的调用。

最佳答案

尝试考虑使用 PrintAssembly命令行参数集。

The following HotSpot options (with an -XX: prefix on the command line) require OpenJDK 7 and an externally loadable disassembler plugin

尝试的建议hsdis plugin执行。但是您需要手动构建它。

要查看生成的代码,您还应该首先使用 -XX:+UnlockDiagnosticVMOptions。换句话说,JVM 将无法识别另一个 PrintAssembly选项。

在你的情况下应该有助于下一个选项:

  • -XX:CompileCommand 可以帮助过滤您的应用程序的输出。
  • -XX:LogFile=foo.log 将有助于在单独的文件中记录此类信息。

关于java - 观察 JIT 的结果,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17820160/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com