Repository navigation
Conversation
f06028b to
bd11ab6
Compare
🟢 Java Benchmark SLOs — All performance SLOs passed
PR vs. master results
Commit: Load and DaCapo benchmarks can be triggered manually in the GitLab pipeline. Results will appear in the Benchmarking Platform UI after completion. |
bd11ab6 to
43011f5
Compare
|
@DataDog review |
There was a problem hiding this comment.
More details
Buffered-header extraction retains public-accessor fallbacks for unsupported layouts, subclasses, and Base64 decoding. The completed static review identified no actionable defect, and human PR discussion raised no additional concerns.
🤖 Bits Code Review · Commit 43011f5
Kafka / producer-benchmarkParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 3 metrics, 0 unstable metrics. See unchanged results
|
Kafka / consumer-benchmarkParameters
See matching parameters
SummaryFound 0 performance improvements and 1 performance regressions! Performance is the same for 2 metrics, 0 unstable metrics.
See unchanged results
|
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
More details
Static review found no actionable regression in buffered-header propagation or the public-accessor fallbacks for subclasses and Base64 extraction. Runtime and Kafka-version compatibility remain unverified.
🤖 Bits Code Review · Commit 43011f5
8caa535 to
7bc7b2d
Compare
There was a problem hiding this comment.
More details
The static review found no reportable defect in the lazy Kafka header path and its accessor fallbacks. Runtime compatibility and allocation savings were not independently exercised.
🤖 Bits Code Review · Commit 7bc7b2d
7bc7b2d to
c87df81
Compare
There was a problem hiding this comment.
More details
The static review identified no actionable propagation regression. Extraction retains public-accessor fallback before lookup initialization, for subclasses with overridden accessors, and for Base64 decoding.
🤖 Bits Code Review · Commit c87df81
c87df81 to
4f9ea44
Compare
There was a problem hiding this comment.
More details
The optimized path retains public-accessor fallbacks for unavailable lookups, header subclasses, and Base64 decoding. The completed static review found no reportable defects; runtime behavior was not exercised.
🤖 Bits Code Review · Commit 4f9ea44
1eb07d0 to
c87df81
Compare
There was a problem hiding this comment.
More details
Delayed metadata activation and unsupported private-field layouts retain Kafka’s public-accessor extraction path, so propagation does not depend on successful lookup initialization.
🤖 Bits Code Review · Commit c87df81
c87df81 to
808fbf5
Compare
There was a problem hiding this comment.
More details
Static analysis identified no actionable defect in lookup initialization, buffer decoding, or public-accessor fallbacks. The human PR discussion contained no substantive review concerns.
🤖 Bits Code Review · Commit 808fbf5
703d4c7 to
a986d0c
Compare
There was a problem hiding this comment.
More details
Static review returned no actionable findings. Runtime compatibility and the reported performance gains remain unverified.
🤖 Bits Code Review · Commit a986d0c
|
Thanks for putting this together. The steady-state numbers look solid, and I agree the two approaches perform the same once warm. My remaining concern is the late-attach path, since that's the main argument for lookup over loading-time accessors. Nothing in the PR or the #13656 thread measures what that path costs, so I measured it two ways. 1. Late retransformation re-warms a warm app (PetClinic, JDK 17, trigger at 60 s, well after warmup)
No code changed in the first arm, yet the JVM discarded compiled code for those classes and everything that inlined them. It then ran about 2,600 compilations under live traffic. Retransformation invalidates whole classes plus their dependents, so a late attach is a second warmup, not a free way to move work out of startup. 2. This PR adds another invalidation after the attach (Kafka consumer, JDK 17) I attached each agent to a consumer that had been running for 60 s and kept consuming past the next metadata refresh. With this PR, setup happens at that refresh (
Neither master nor #13600 lost any app code at the same refresh. On this thin consumer the recompile was cheap: no throughput dip I could separate from noise. But the cost grows with how much is inlined around extraction, and a real consumer's loop carries far more than this benchmark's. It's the same pattern as (1) on a smaller scale: a late invalidation into the application's own hot code, after warmup. What I'd like to see Either:
I think the policy should be to defer work only to points before the target classes load. Retransforming classes that are already loaded should count as a real cost that needs justification. Caveats: both are single runs on a laptop, and single runs vary (a later PetClinic |
What Does This Do
Extracts propagation keys and UTF-8 values directly from accessible Kafka header-buffer arrays to avoid copies.
Motivation
Use the approach from #13600 without changing the structure of
RecordHeaderor requiringFieldAccessors.Additional Notes
Metadata.update(...). This avoids initialization checks on each header operation. After late attachment, activation can wait for the next metadata response.key()accessor for buffers without accessible arrays. This preserves synchronization for concurrent header reads in Kafka 4.4.Validation
On Java 17, all 16 focused cases passed with Kafka 3.8.0 and all 17 passed with Kafka 4.4.0, including concurrent reads. Tests cover delayed activation, buffer variants, accessor fallback, and propagation equivalence. The regression test for keys without accessible arrays fails without the fallback.
Both test source sets, JMH compilation, and Spotless pass. Earlier validation covered Java 8. Muzzle and full Kafka suites remain for CI.
Benchmarks
Mean allocation was 12.3–15.9% lower than baseline across all six cases. Mean processing time was 2.5–10.9% lower on Java 8/17 and 3.3–4.4% higher on Java 21. Time means relative to #13600 ranged from -0.7% to +2.6%; the tables report between-fork variation.
Revisions: branch
a986d0c0976, baselinedd09e2418b7, #13600cdee7363337. Header implementations are compiled from these revisions. The shared tracer/runtime and timed workload are unchanged from the previous comparison; all use Kafka 3.8.0.Method: JMH 1.36 with
-prof gc, on the same macOS arm64 machine. Zulu HotSpot 8u514, 17.0.21.1, and 21.0.13.1. Five fresh forks per case, run serially (90 total); JDK and header-count order rotate, while implementation order is fixed within each case. One thread, 5 × 2 s warmup, 7 × 3 s measurement. JVM flags:-Xms512m -Xmx512m -XX:+UseG1GC -XX:ActiveProcessorCount=4 -XX:ParallelGCThreads=2 -XX:ConcGCThreads=1.Each invocation parses and consumes 500 records through the production
TracingIteratorandCoreTracer: six propagation headers, 0/3 application headers, 100-byte values, distinct parent contexts, and 10% sampling. DSM and time-in-queue are off. The application reads payloads only. All 90 forks passed checks for extraction, header structure, 500 completed spans, parent links, and sampling; candidate forks also verified metadata-driven setup activation.This measures the latest header code in steady-state processing of heap-backed Kafka 3.8 headers with a blackhole writer. It excludes network traffic, full client bookkeeping, setup, and trace serialization. Kafka 4.4 and direct/read-only key fallback performance are outside this measurement.
Processing time: ns/record, mean ± sample standard deviation across five forks.
Allocation: bytes/record, mean across five forks.