Skip to content

Conversation

@dougqh
Copy link
Contributor

@dougqh dougqh commented Nov 21, 2025

What Does This Do

Adds primitive setters to DDSpanContext

Motivation

TagMap can store primitive in its entries directly without boxing
But to take advantage of TagMap, we need to avoid auto-boxing in instrumentation, DDSpan, DDSpanContext
DDSpan already had primitive setters, but those call into DDSpanContext which didn't have primitive setters

Additional Notes

This code has been structured to behave optimally for both LegagyTagMap (e.g. HashMap) which boxes and OptimizedTagMap which avoids boxing

Right now, the tracer will still end up boxing in the serialization code, but this change at least moves the boxing out of the instrumentation / application critical path. Boxing during serialization will be addressed in a separate pull request.

Contributor Checklist

Jira ticket: [PROJ-IDENT]

Previous static extraction caused a test to fail because links logic relied on having a side effect on the builder instance's List<AgentSpanLink>
Adding primitive setters to DDSpanContext to take advantage of TagMap primitive storage

Using precheck of tagInterceptor.needsIntercept to avoid boxing while calling tagInterceptor.interceptTag
@dougqh dougqh requested a review from a team as a code owner November 21, 2025 21:21
@dougqh dougqh added the type: enhancement Enhancements and improvements label Nov 21, 2025
@dougqh dougqh requested a review from ygree November 21, 2025 21:21
@dougqh dougqh added comp: core Tracer core tag: performance Performance related changes labels Nov 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp: core Tracer core tag: performance Performance related changes type: enhancement Enhancements and improvements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants