Repository navigation
Conversation
This was referenced Oct 23, 2026
This comment has been minimized.
This comment has been minimized.
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. |
DDSpanContext holds its IdStore (also its tag lock) and its HashStore instead of one TagMap, and routes each write to the store that holds the tag: a name is resolved once and routed, and a write by id goes straight to the id store. The custom store is borrowed read-only from the read-through parent until the span's first custom write. The eager post-processors already read and write the span through SpanContents. The lazy post-processors and the serializer still take a TagMap: the span builds a view over its stores once, at serialization, and caches it (about 32 B per span until they move to SpanContents). TagMap.Internals, the core's trusted side door, is gone: the stores are the direct path. The constructors drop the unused tagsSize parameter. Allocation, 7-span web-request trace: +104 B (+1.3%), from the new DDSpanContext fields (8 B per span) and the first custom store. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
dougqh
force-pushed
the
dougqh/tagmap-split-known-custom
branch
from
October 23, 2026 04:14
c6d9c8c to
074d3db
Compare
dougqh
changed the base branch from
dougqh/tagmap-hash-support
to
dougqh/tagmap-store-facade
October 23, 2026 04:14
This branch has not been deployed
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 Does This Do
DDSpanContextowns its tag stores directly, instead of oneTagMap:IdStore, which is also the span's tag lock.HashStore, borrowed read-only from the read-through parent until the span's first custom write.Each write is routed to the store that holds the tag. A name is resolved once and routed, and a write by id goes straight to the id store.
SpanContents(Introduce SpanContents for eager tag post-processors (dense store - part 3) #13001), so they need noTagMap.TagMap. The span builds a view over its stores once, at serialization, and caches it. That costs about 32 B per span until they move toSpanContents.TagMap.Internalsis gone, since the stores are now the direct path. The forbidden-API entry for it goes too.tagsSizeparameter, which is why many tests change by one line.Motivation
This is the last of three PRs that replace the span's single
TagMapwith two stores split by tag kind. The stores and theTagMapfacade are in the two PRs below this one. Here, the span stops going throughTagMapfor its own reads and writes. That gives the dense store (#13004) a place as the known-tag half.Additional Notes
Allocation, 7-span web-request trace, application thread only:
DDSpanContextfields (customTags,customTagsBorrowed,tagView), 8 B per span.HashStorebeing created, but it isn't confirmed yet.SpanContents, building the view on the application thread made this +4.1%.Tests: internal-api and dd-trace-core pass. The only failures are the two
TracerConnectionReliabilityTestcases, which need Docker.Where this is going
This PR is one step in replacing the span's single
TagMapwith storage that knows each tag's kind. The goal is to cut what every span allocates on the application thread, without changing behavior.The end state
TagMapbecomes a thin view for code outside the span.Entryobject per tag, and each span's store is presized from a per-operation hint. With the flag on, a web-request-shaped trace allocates about 30% less on the application thread than on master.SpanContents, not aTagMap. That covers post-processors now and serializers later, so noTagMapview gets built for them.SpanContentsstarts with four methods and grows a name, id and primitive API as more readers move to it.Later, not in this stack: cheaper read-through to parent spans, trace-level tags in a per-trace holder (
TraceSegment), and primitive tag values without boxing.The stack. This replaces #12918, split into pieces that can each be reviewed, and measured, on their own.
TagMap. This is the stack's only behavior change, kept separate on purpose.TagMap, and addTraceShapeBenchmarkSpanContentsfor the eager post-processorsTagMap's bucket mechanics intoHashSupport(a pure move)TagMapa facade over the two storestrace.experimental.dense.tags.enabled(off by default)Every PR after #12999 is behavior-preserving.
The pieces' allocation figures come from a deterministic per-thread probe (
ThreadMXBeanallocated bytes) that builds the same 7-span trace asTraceShapeBenchmark. The #12992 and #12926 figures come fromTraceShapeBenchmarkitself.🤖 Generated with Claude Code