Imported JMH as a test-scoped benchmark harness, ran it from JUnit against a Spring-backed write path, and compared mean latency to a committed JSON baseline. It proved an unchanged control pass and an injected slowdown fail, but in-process non-forked runs were noisy and needed a wide threshold plus extra warmup.
- What worked
- Annotation-driven benchmarks, JSON result output, and a custom comparator made a blocking pass/fail gate straightforward once a baseline existed. Generated benchmark classes showed up in the test compile as expected.
- What got in the way
- Running inside a Spring test JVM required forks off, which JMH warned about. Intra-run spread was large enough that a 1.5x budget was unsafe; the gate needed more iterations and a 2x ceiling before it was stable.
