Skip to content

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

Draft
dougqh wants to merge 1 commit into
dougqh/tag-registry-generatorfrom
dougqh/tag-id-api
Draft

Id-keyed TagMap.set(long) + insertion-comparison benchmark#11901
dougqh wants to merge 1 commit into
dougqh/tag-registry-generatorfrom
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 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.96 s 13.98 s [-0.9%; +0.6%] (no difference)
startup:insecure-bank:tracing:Agent 12.92 s 13.03 s [-1.7%; +0.1%] (no difference)
startup:petclinic:appsec:Agent 16.95 s 16.87 s [-0.6%; +1.6%] (no difference)
startup:petclinic:iast:Agent 16.90 s 16.94 s [-1.1%; +0.7%] (no difference)
startup:petclinic:profiling:Agent 16.06 s 16.83 s [-9.1%; -0.1%] (maybe better)
startup:petclinic:sca:Agent 16.97 s 16.78 s [+0.1%; +2.3%] (maybe worse)
startup:petclinic:tracing:Agent 16.15 s 16.07 s [-0.5%; +1.4%] (no difference)

Commit: 7e3ed31f · 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.

@dougqh dougqh force-pushed the dougqh/dense-bloom-filter branch 2 times, most recently from 267ebad to 56550cb Compare July 15, 2026 21:23
set(long id, Object value) is the id-keyed insertion path: the caller passes a
resolved KnownTags id, so it skips the keyOf name resolution the set(String, ...)
methods pay and stores densely. The id must be a stored known-tag id; custom
names have no id and use the name-keyed setters. The name is resolved lazily only
to clear a read-through tombstone (rare).

Adds TagMapInsertionComparisonBenchmark (dense vs HashMap insertion, -prof gc) —
the isolated micro where the dense store + bloom insertion win shows, and the
home for the id-keyed vs string-keyed comparison.

Reconciled onto the tag registry (#11961).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@dougqh dougqh changed the base branch from dougqh/dense-bloom-filter to dougqh/tag-registry-generator July 15, 2026 21:27
@dougqh dougqh force-pushed the dougqh/tag-id-api branch from f0cb351 to 7e3ed31 Compare July 15, 2026 21:27
@datadog-prod-us1-6

datadog-prod-us1-6 Bot commented Jul 15, 2026

Copy link
Copy Markdown

🎯 Code Coverage (details)
Patch Coverage: 91.46%
Overall Coverage: 57.31% (-0.01%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 7e3ed31 | Docs | Datadog PR Page | Give us feedback!

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