RFR: 7904058: Enable BenchmarkParams construction to be overriden

Galder Zamarreño galder at openjdk.org
Tue Jul 8 09:23:27 UTC 2025


This is the **second** in a series of PRs that I will be sending over the next few days, which make extending JMH to benchmark Java code running as GraalVM native images more easily. The codename for this extension is Fibula. It can still work without this PRs but without them the extension has to duplicate code that exists in JMH, which is not desirable.

This PR enables `BenchmarkParams` construction to be overriden, in order to easily support JMH use case for benchmarking native images. The JIRA contains a detailed explanation. Having this PR in simplifies construction of `BenchmarkParams` instance. The changes https://github.com/galderz/fibula/commit/8fd8cf3f4eb1c6f37de7f807bfc697ef981a3e05#diff-601b6d98eff18db8a804efb415d515c3d397d42b9c982713b72c37bea2ebbf18 demonstrate the simplification enabled by the changes here.

Here is the PR list for reference:
1. [Make OutputFormatAdapter public](https://github.com/openjdk/jmh/pull/158)
2. [Enable BenchmarkParams construction to be overriden](https://github.com/openjdk/jmh/pull/160)

-------------

Commit messages:
 - Enable BenchmarkParams construction to be overriden

Changes: https://git.openjdk.org/jmh/pull/160/files
  Webrev: https://webrevs.openjdk.org/?repo=jmh&pr=160&range=00
  Issue: https://bugs.openjdk.org/browse/CODETOOLS-7904058
  Stats: 2 lines in 2 files changed: 0 ins; 0 del; 2 mod
  Patch: https://git.openjdk.org/jmh/pull/160.diff
  Fetch: git fetch https://git.openjdk.org/jmh.git pull/160/head:pull/160

PR: https://git.openjdk.org/jmh/pull/160


More information about the jmh-dev mailing list