Skip to content

Id-keyed TagMap.set(long) + insertion-comparison benchmark#11901

Draft
dougqh wants to merge 2 commits into
dougqh/dense-bloom-filterfrom
dougqh/tag-id-api
Draft

Id-keyed TagMap.set(long) + insertion-comparison benchmark#11901
dougqh wants to merge 2 commits into
dougqh/dense-bloom-filterfrom
dougqh/tag-id-api

Conversation

@dougqh

@dougqh dougqh commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

What

On top of the bloom fast-path (#11900):

  1. TagMap.set(long id, Object) — the id-keyed insertion path: given a resolved KnownTags.*_ID, store densely and skip keyOf name resolution. Sole TagMap impl (OptimizedTagMap); the id must be a stored known id (custom names keep the name setters).
  2. 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)

arm alloc B/op (7 / 12) thrpt vs HashMap (7 / 12)
hashMap 352 / 512 1.00× / 1.00×
tagMapById 184 / 408 0.99× / 0.63×
tagMapByName 184 / 408 0.66× / 0.50×
tagMapCustom (1.0 bucket) 416 / 712 0.59× / 0.46×
  • Alloc: dense ~half of HashMap; id == name (the bloom/dense win is CPU, not alloc).
  • Throughput: id-insertion reaches HashMap parity at typical tag counts (0.99× @7) and beats the 1.0 bucket path 1.4–1.7×. The 12-tag gap is a sizing/resize artifact (SpanPrototype's right-sizing / a larger init cap closes it), not a scan — the tags don't collide under the bloom's fieldPos & 63.

Scope

Minimal id API (TagMap level). Full AgentSpan.setTag(long) + the KnownTags call-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 + SpanBuilder id support; per-type graph coloring; master run to pin true-1.0 (no keyOf).

🤖 Generated with Claude Code

dougqh and others added 2 commits July 9, 2026 09:08
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>
@dougqh dougqh added comp: core Tracer core tag: ai generated Largely based on code generated by an AI or LLM tag: no release notes Changes to exclude from release notes type: refactoring labels Jul 9, 2026
@dd-octo-sts

dd-octo-sts Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

🟢 Java Benchmark SLOs — All performance SLOs passed

Suite Status
Startup 🟢 pass

SLO thresholds are defined here based on automatically generated metrics. A warning is raised when results are within 5% of the threshold.

PR vs. master results
Scenario Candidate master Δ (95% CI of mean)
startup:insecure-bank:iast:Agent 13.88 s 13.97 s [-1.3%; -0.0%] (maybe better)
startup:insecure-bank:tracing:Agent 12.95 s 13.05 s [-1.5%; +0.0%] (no difference)
startup:petclinic:appsec:Agent 17.49 s 17.21 s [+0.6%; +2.6%] (maybe worse)
startup:petclinic:iast:Agent 17.31 s 17.54 s [-2.1%; -0.5%] (maybe better)
startup:petclinic:profiling:Agent 17.45 s 17.41 s [-1.0%; +1.4%] (no difference)
startup:petclinic:sca:Agent 17.61 s 17.54 s [-0.3%; +1.1%] (no difference)
startup:petclinic:tracing:Agent 16.59 s 16.62 s [-1.4%; +1.0%] (no difference)

Commit: f0cb351d · CI Pipeline · Benchmarking Platform UI


Load and DaCapo benchmarks can be triggered manually in the GitLab pipeline. Results will appear in the Benchmarking Platform UI after completion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp: core Tracer core tag: ai generated Largely based on code generated by an AI or LLM tag: no release notes Changes to exclude from release notes type: refactoring

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant