Skip to content

Remove LegacyTagMap; OptimizedTagMap is the sole TagMap implementation#11678

Draft
dougqh wants to merge 2 commits into
masterfrom
dougqh/kill-legacy-tagmap
Draft

Remove LegacyTagMap; OptimizedTagMap is the sole TagMap implementation#11678
dougqh wants to merge 2 commits into
masterfrom
dougqh/kill-legacy-tagmap

Conversation

@dougqh

@dougqh dougqh commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

What

OptimizedTagMap has been the default for some time (the optimized.map.enabled flag defaulted to true). With Legacy effectively dead, this removes it so OptimizedTagMap is the sole TagMap implementor — satisfying CHA's unique-implementor precondition (a prerequisite for upcoming read-through / dense-store work).

Changes

  • Delete LegacyTagMap and the whole TagMapFactory abstraction (the abstract class + its lone OptimizedTagMapFactory); TagMap.create()/create(int)/EMPTY now construct OptimizedTagMap directly.
  • Delete the now-trivial TagMapType / TagMapTypePair test enums and de-parameterize their tests to plain @Test. TagMapScenario (parameterizes by size) is kept.
  • Remove the optimized.map.enabled flagConfig field/getter, GeneralConfig constant, and the metadata/supported-configurations.json entry. Per the Config team, removing the registry entry is detected automatically at the next release (FPD + public docs get a Max Version: v1.xx.0 marker).

Notable

  • Fixes a latent static-init cycle that removing the flag exposed: TagMap (interface with default methods) ↔ OptimizedTagMap could leave TagMap.EMPTY null when OptimizedTagMap initialized first. A lazy EmptyHolder builds the empty singleton via the constructor instead of reading a mid-<clinit> static.
  • isOptimized() is intentionally left in place — it now constant-folds to true and is DCE'd at its call site (DDSpanContext); simplifying it away is a trivial follow-up.

Validation

  • internal-api TagMap suite green (TagMapTest, TagMapLedgerTest, TagMapFuzzTest); internal-api / dd-trace-api / dd-trace-core compile clean.
  • ⏳ Draft pending a broader dd-trace-core integration run before marking ready.

Benchmark — overhead-neutral (parity)

TagMapAccessBenchmark (threading-correct, @Threads(8)) run on the pre-kill tree vs. this branch — the two differ by exactly these two commits (verified byte-identical pre-image). Throughput, 1 fork, 3 warmup + 5 measurement iters:

Benchmark Pre-kill (ops/s) Post-kill (ops/s) Δ
insert 55.2M ±2.7M 53.9M ±6.2M −2.3%
getObject 91.8M ±8.7M 93.3M ±10.2M +1.6%
getEntry 91.7M ±18.2M 93.3M ±11.2M +1.8%

All deltas are within run-to-run error (single fork) → no measurable change, as expected for a dead-code removal.

🤖 Generated with Claude Code

dougqh and others added 2 commits June 18, 2026 13:32
With one implementor, the optimized/legacy split is dead weight. Delete
LegacyTagMap and LegacyTagMapFactory; collapse the whole TagMapFactory
abstraction (TagMap.create()/create(int)/EMPTY now construct
OptimizedTagMap directly via a lazy EmptyHolder that avoids a
TagMap<->OptimizedTagMap static-init cycle). OptimizedTagMap is the sole
TagMap implementor, satisfying CHA's unique-implementor precondition.

Delete the now-trivial TagMapType/TagMapTypePair test enums and
de-parameterize their tests to plain @test; TagMapScenario (size-based)
stays. Drop stale "legacy and optimized" references from javadoc.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The flag only chose between the optimized and legacy TagMap impls; with
Legacy gone it controls nothing. Remove the Config field/getter, the
GeneralConfig constant, and the metadata/supported-configurations.json
entry. Per the Config team, removing the registry entry is detected
automatically at the next release (FPD + public docs get a
"Max Version: v1.xx.0" marker), so the hard delete is the correct process.

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 Jun 18, 2026
@datadog-datadog-prod-us1-2

Copy link
Copy Markdown
Contributor

Pipelines

Fix all issues with BitsAI

⚠️ Warnings

🚦 1 Pipeline job failed

DataDog/apm-reliability/dd-trace-java | linux-java-spring-petclinic-sca-load-parallel   View in Datadog   GitLab

Useful? React with 👍 / 👎

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

@dd-octo-sts

dd-octo-sts Bot commented Jun 18, 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.97 s 13.97 s [-0.7%; +0.7%] (no difference)
startup:insecure-bank:tracing:Agent 12.88 s 12.98 s [-1.4%; -0.1%] (maybe better)
startup:petclinic:appsec:Agent 16.76 s 16.59 s [+0.0%; +2.0%] (maybe worse)
startup:petclinic:iast:Agent 16.95 s 17.01 s [-1.1%; +0.4%] (no difference)
startup:petclinic:profiling:Agent 16.83 s 16.93 s [-1.6%; +0.4%] (no difference)
startup:petclinic:sca:Agent 16.87 s 16.79 s [-0.5%; +1.3%] (no difference)
startup:petclinic:tracing:Agent 16.06 s 16.06 s [-1.0%; +1.0%] (no difference)

Commit: 82f5311f · 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