Skip to content

Deprecate TagMap.create(int) — its size hint is a no-op#11978

Draft
dougqh wants to merge 1 commit into
masterfrom
dougqh/deprecate-tagmap-create-int
Draft

Deprecate TagMap.create(int) — its size hint is a no-op#11978
dougqh wants to merge 1 commit into
masterfrom
dougqh/deprecate-tagmap-create-int

Conversation

@dougqh

@dougqh dougqh commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

What Does This Do

TagMap.create(int size) ignores its size — the body is just return new OptimizedTagMap();. TagMap's storage can't honor a size hint without compromising its other optimizations, so the size arg is vestigial and misleading (callers think they're pre-sizing; they aren't).

  • Mark create(int) @Deprecated, pointing at create(), with a javadoc explaining the size is ignored.
  • Migrate the two TagMap-internal callers off it — fromMap and Ledger.build() — since those components already know create does nothing with the size.

Deliberately left

The three external callers keep using it for now: CoreTracer, DDSpanContext, and TagContext. Their deprecation warnings are a useful to-do list — a dedicated sizing mechanism is being developed separately (for the upcoming dense storage), and DDSpanContext in particular is its main target, so those sites will be converted there rather than churned here.

Notes

  • Behavior-neutral: create(int) and create() are identical today, so the migrated calls change nothing at runtime.
  • Ledger.estimateSize() stays (uncalled internally now, but plausibly a future sizing-hint input).
  • Verified: internal-api + dd-trace-core compile (deprecation is a warning, not an error), SpotBugs clean, TagMap suite green, coverage gate green.

tag: ai generated
tag: no release note

🤖 Generated with Claude Code

create(int) ignores its size (returns new OptimizedTagMap()); TagMap's
storage can't honor a size hint without compromising its other
optimizations. Mark it @deprecated pointing at create(), and migrate the
two TagMap-internal callers (fromMap, Ledger.build) off it. The external
callers (CoreTracer, DDSpanContext, TagContext) are left -- their
deprecation warnings flag the sites a future dedicated sizing mechanism
will convert (DDSpanContext especially).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@dougqh dougqh added comp: core Tracer core tag: no release notes Changes to exclude from release notes type: refactoring tag: ai generated Largely based on code generated by an AI or LLM labels Jul 16, 2026
@datadog-datadog-prod-us1

datadog-datadog-prod-us1 Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

🎯 Code Coverage (details)
Patch Coverage: 100.00%
Overall Coverage: 57.16% (-0.13%)

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

@dd-octo-sts

dd-octo-sts Bot commented Jul 16, 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 14.00 s 14.02 s [-1.1%; +0.8%] (no difference)
startup:insecure-bank:tracing:Agent 12.97 s 13.05 s [-1.2%; +0.0%] (no difference)
startup:petclinic:appsec:Agent 17.43 s 17.22 s [+0.4%; +2.1%] (maybe worse)
startup:petclinic:iast:Agent 17.25 s 17.44 s [-1.8%; -0.4%] (maybe better)
startup:petclinic:profiling:Agent 17.42 s 16.56 s [+0.9%; +9.6%] (maybe worse)
startup:petclinic:sca:Agent 17.48 s 17.39 s [-0.6%; +1.5%] (no difference)
startup:petclinic:tracing:Agent 16.60 s 16.54 s [-0.6%; +1.3%] (no difference)

Commit: 9ee448a7 · 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