This is an automated email from the ASF dual-hosted git repository.
jamesbognar pushed a commit to branch docs
in repository https://gitbox.apache.org/repos/asf/juneau.git
The following commit(s) were added to refs/heads/docs by this push:
new e47fb16b2e feat(utest): JMH observability NoOp zero-allocation
benchmark (TODO-116)
e47fb16b2e is described below
commit e47fb16b2eca9a82703085590de9539ab0b40a9e
Author: James Bognar <[email protected]>
AuthorDate: Thu May 28 17:31:36 2026 -0400
feat(utest): JMH observability NoOp zero-allocation benchmark (TODO-116)
Add a -Pmicrobench-gated JMH harness under juneau-utest/src/jmh/java/
with ObservabilityNoopBenchmark asserting the RestOpInvoker
observability block is zero-allocation when MetricsRecorder.NOOP and
TracerHook.NOOP are resolved. gc.alloc.rate.norm ≈ 0 B/op recorded in
perf-baseline.txt [observability] section. New scripts/microbench.py
wrapper. Default mvn test build untouched (profile-gated).
---
pages/release-notes/9.5.0.md | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/pages/release-notes/9.5.0.md b/pages/release-notes/9.5.0.md
index 2ada192330..8c5128f9ff 100644
--- a/pages/release-notes/9.5.0.md
+++ b/pages/release-notes/9.5.0.md
@@ -4765,6 +4765,18 @@ Added a paired terminal/chat workflow for triaging
SonarCloud findings on a sour
See `.cursor/commands/sonarqube.md` and the `5.2. SonarQube Script` section in
`AGENTS.md` for the full reference.
+#### JMH micro-benchmark: observability NoOp zero-allocation gate (TODO-116)
+
+Added a JMH micro-benchmark harness and wrapper script asserting the
`RestOpInvoker` observability hot path allocates **zero objects per
invocation** when both `MetricsRecorder` and `TracerHook` resolve to their NoOp
singletons.
+
+- **Benchmark class:**
`juneau-utest/.../microbench/observability/ObservabilityNoopBenchmark` —
mirrors the exact `RestOpInvoker.invoke()` observability block
(`tracer.startSpan()` → NoOp scope lifecycle → `recorder.record()`) using
interface-typed fields to keep virtual-dispatch in play, then asserts
`gc.alloc.rate.norm ≤ 8 bytes/op`.
+- **Wrapper script:** `python3 scripts/microbench.py observability` compiles
via `mvn -Pmicrobench`, runs the benchmark with `-prof gc`, reads the JSON
output, and exits 0 on pass / non-zero on threshold breach. Use `--threshold 0`
to tighten the gate.
+- **Perf baseline:** `juneau-utest/perf-baseline.txt` gains an
`[observability]` section recording `observability-noop-alloc-bytes-per-op =
0.000` (≈ 10⁻⁴ B/op measured on Apple M1 Pro / Zulu JDK 25).
+- **Maven profile:** `-Pmicrobench` in `juneau-utest/pom.xml` adds
`<proc>full</proc>` to force annotation processing (required for JMH's
`META-INF/BenchmarkList` generation) and configures `exec-maven-plugin 3.3.0`
with `classpathScope=test`.
+- **Developer docs:** `juneau-utest/README.md` documents invocation, threshold
customisation, and the pattern for adding future benchmarks.
+
+The benchmark confirms FINISHED-67's zero-allocation promise for the NoOp
short-circuit; the TODO-139 CI gate follow-on can wire this result into a
hard-fail check.
+
#### Docs push-time smoke check (TODO-130)
`scripts/push.py` now runs a Docusaurus build smoke check (`build-docs.py
--skip-maven`) before pushing `juneau-docs` changes. When `push.py` detects
pending commits in the sibling `juneau-docs` repo, it runs `python3
scripts/build-docs.py --skip-maven` first; a non-zero exit aborts the push with
a clear error message (`❌ Docs smoke check failed — fix the Docusaurus build
before pushing juneau-docs.`). This catches broken admonitions, malformed MDX,
or bad plugin config before the commit [...]