Repository navigation
Key the v0.5 trace dictionary by string content (quick perf fix) - #13400
gh-worker-dd-mergequeue-cf854d[bot] merged 1 commit into
Conversation
TraceMapperV0_5 keys its string dictionary on the value as written, and deduplicates only values that are equals. URIUtils.LazyUrl hashes its content but keeps identity equality, so every request's http.url became its own dictionary entry, all in one hash bucket. HashMap treeifies the bucket, but LazyUrl isn't Comparable, so each lookup walked every entry: serializing went quadratic in the requests per payload, and the URL was re-encoded into the dictionary each time. Convert CharSequences other than String and UTF8BytesString to String before the lookup (LazyUrl caches its rendering, so this is free), as v1's string table already does. Values longer than the dictionary are still rejected without being converted. PetClinic owner-detail, 2 GB heap, 8,000 req/s, 100% sampled, v0.5: the serializer thread's CPU samples drop from 257-347 (85-89% in HashMap$TreeNode.find / comparableClassFor) to 57-62, below v0.4's 91; p90 0.62-0.74 ms vs 1.84 ms for v0.4. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Hi! 👋 Thanks for your pull request! 🎉 To help us review it, please make sure to:
If you need help, please check our contributing guidelines. |
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
Content-based keys address repeated LazyUrl dictionary entries while preserving the pre-conversion capacity guard. Static review found no reportable defect.
🤖 Bits Code Review · Commit 3c3fd56
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3c3fd567b9
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
🟢 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. |
|
/merge |
|
View all feedbacks in Devflow UI.
It will be processed automatically as soon as GitHub reports it as mergeable. View in MergeQueue UI.
The expected merge time in
Build pipeline has failing jobs for 49c836d: What to do next?
|
|
/merge |
|
View all feedbacks in Devflow UI.
The expected merge time in
|
1e5d888
into
master
What Does This Do
TraceMapperV0_5now keys its string dictionary by content: aCharSequenceother thanStringorUTF8BytesStringis converted to aStringbefore the lookup, as v1's string table already does. Values longer than the dictionary are still rejected without being converted (#13024's bound).Motivation
The v0.5 dictionary only deduplicates values that are
equals.URIUtils.LazyUrloverrideshashCode()(its content's hash) but notequals(), so:http.urlbecame its own dictionary entry, re-encoding the same URL into the payload each time, andHashMapbucket. The bucket treeifies past 8 entries, butLazyUrlisn'tComparable, so each lookup walked every entry: serializing went quadratic in the requests per payload.Profiling PetClinic owner-detail (2 GB heap, constant 8,000 req/s, 100% sampled), 85–89% of the v0.5 serializer thread's CPU samples were in
HashMap$TreeNode.find/HashMap.comparableClassFor.With the fix, v0.5 serializes more cheaply than v0.4 while sending far fewer bytes (~8× fewer than v0.4 even before this fix), and its p90 is close to OpenTelemetry's ~0.5 ms on the same setup.
Additional Notes
equalCharSequenceTagValuesShareOneDictionaryEntrywrites 50 spans, each with its ownLazyUrlfor the same URL, and expects one dictionary entry. It fails before this change (50 entries).LazyUrloverridinghashCodewithoutequalsis fixed separately; this change protects the dictionary from anyCharSequencewithout content equality either way.🤖 Generated with Claude Code