Id-keyed TagMap.set(long) + insertion-comparison benchmark#11901
Draft
dougqh wants to merge 2 commits into
Draft
Id-keyed TagMap.set(long) + insertion-comparison benchmark#11901dougqh wants to merge 2 commits into
dougqh wants to merge 2 commits into
Conversation
set(long) is the id-keyed insertion path (skips keyOf). The benchmark compares HashMap / 1.0-bucket / 2.0-name / 2.0-id on alloc + throughput. Header numbers are PRE-bloom-filter; refresh after the bloom lands + this rebases onto it. Follow-ups: id support for TagMap.Ledger + SpanBuilder (deferred). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Idle-box run (-prof gc -f 5 -wi 5 -i 5): dense-id reaches HashMap parity at 7 tags (0.99x, was 0.91x pre-bloom), 0.63x at 12; alloc still ~half HashMap (184/408 vs 352/512), +8 B/op for the bloom's long field. id==name on alloc. Beat at higher counts awaits per-type graph coloring (crude fieldPos&63 collides as tags grow). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Contributor
🟢 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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
On top of the bloom fast-path (#11900):
TagMap.set(long id, Object)— the id-keyed insertion path: given a resolvedKnownTags.*_ID, store densely and skipkeyOfname resolution. SoleTagMapimpl (OptimizedTagMap); the id must be a stored known id (custom names keep the name setters).TagMapInsertionComparisonBenchmark— HashMap / 1.0-bucket / 2.0-name / 2.0-id, alloc + throughput; the numbers behind the deck's slides 3/7/8.Results (idle box,
-prof gc -f 5 -wi 5 -i 5; persisted in the benchmark header)hashMaptagMapByIdtagMapByNametagMapCustom(1.0 bucket)id==name(the bloom/dense win is CPU, not alloc).fieldPos & 63.Scope
Minimal id API (TagMap level). Full
AgentSpan.setTag(long)+ theKnownTagscall-site migration are follow-ons.set(long)has no production caller yet — by design, it lands with its benchmark evidence ahead of the migration that consumes it (each PR stands alone in sequence).Stacking
#11814 (dense storage) → #11900 (bloom) → this (id API + comparison benchmark).
Follow-ups
TagMap.Ledger+SpanBuilderid support; per-type graph coloring; master run to pin true-1.0 (nokeyOf).🤖 Generated with Claude Code