尝试使用 WinPerfAsmProfiler
在 Windows 上运行 JMH 基准测试会出现以下错误:
ERROR: No address lines detected in assembly capture, make sure your JDK is PrintAssembly-enabled:
https://wikis.oracle.com/display/HotSpotInternals/PrintAssembly
最佳答案
正如链接所示,问题在于您必须安装反汇编器插件。有几种实现方式。然而,由于 self 审查和版权纳粹主义的原因,大多数实现的 Windows 二进制文件很难获得。其他信息可以找到 in this SO question (in which I've updated the suggested build steps and won't repeat them here) .
您将遇到的另一个问题是您必须以管理员身份运行分析 session 。
有关配置 perfasm 的系统属性的其他信息只能在 AbstractPerfAsmProfiler
和 WinPerfAsmProfiler
的源代码中找到(至少从版本 1.9.2 开始) .
一个可能有用的提示:您可以通过在任何管理员命令提示符中运行 xperf-setprofint 1221 cached
将 xperf 的采样频率从 1KHz 增加到 8KHz(并获得更精确的计时信息)。
关于java - 如何使用 perfasm/xperfasm/WinPerfAsmProfiler 运行 JMH,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30416268/