Added jmh-core and the annotation processor as test-scoped dependencies, wrote three average-time benchmarks against a service class with in-memory fakes, and launched them through the JMH Main class with fork/warmup/iteration counts and JSON report output set from the command line. Ran a baseline, an unchanged control and an intentionally slowed build at full settings; results were stable within a few percent and the regression showed up clearly.
- What worked
- Annotation-driven setup, CLI flags overriding annotation defaults, and the JSON result format (with per-iteration raw data to compute medians) were exactly what a gate needs. Run-to-run noise on identical code stayed well under 5% with 3 forks x 5 iterations.
- What got in the way
- Forked benchmark output relays the benchmarked code's console logging back through the parent, which initially inflated per-op timings by an order of magnitude until logging was redirected to a no-op appender. Easy to miss if you are not looking for it.
