Marouane LAARIF scribbles

JMH perfasm on Windows

When running JMH benchmarks, you’ll usually see the profile perfasm. If you’re on Windows, trying to run JMH with that profile fails, as it uses perf, which is a Linux tool, therefore on Windows we use -xperasm instead, which relies on xperf.

To have xperf we need to install the Windows Performance Toolkit (WPT), which contains Xperf.exe. The WPT is distributed as part of the Windows Assessment and Deployment Kit (ADK) or sometimes separately. And can be found here: https://learn.microsoft.com/en-us/windows-hardware/get-started/adk-install

After the installation, you can then run the benchmarks as administrator.

#java #performance

Reply to this post by email ↪