-
Notifications
You must be signed in to change notification settings - Fork 17
Performance Benchmarking Guide with JMH
Samuel Abramov edited this page Nov 20, 2023
·
1 revision
To benchmark our performance-critical code, we use JMH (Java Microbenchmark Harness). Follow these steps to set up and execute the benchmarks:
- Download the Dataset: Download a benchmark dataset from the provided link. Benchmark Dataset
-
Extract the Dataset: After downloading, extract the dataset into the directory
edux/benchmark-data/.- Important: Do not rename the folder after extraction.
A complete run can take more than 30 min.
-
Execute Benchmarks Using Gradle:
- Use the Gradle command to run the JMH benchmarks. This can typically be done with a command like
./gradlew jmhin your terminal or command prompt, depending on your project's Gradle setup.
- Use the Gradle command to run the JMH benchmarks. This can typically be done with a command like
-
JSON Results File:
- After the benchmarks have been run, a JSON file with the results will be created.
- This file can typically be found in the
edux\lib\benchmark-results.jsondirectory, or the directory specified in your JMH configuration.
-
Use a Visualization Tool:
- You can use tools like JMH Visualizer to upload and visually analyze the JSON results file.
- This helps in better understanding the performance metrics and identifying any bottlenecks or areas for improvement.
By following these steps, you can effectively benchmark and analyze the performance of your critical code segments using JMH.
EDUX Implementation Details