Repository navigation
Conversation
Maps a finished single-span trace with events and links through the v0.4, v0.5 and v1 mappers. Events are recorded through AgentSpan.addEvent when it exists, otherwise as the pre-encoded events tag, so the same source runs before and after #12768. The Javadoc records the #12768 before/after results. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
AGENTS.md now requires JMH before/after numbers for performance claims and forbids unmodifiable wrappers on internal accessors in dd-trace-core. The perf-review skill applies these as findings for dd-trace-core and keeps its advisory posture elsewhere. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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. |
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
SpanEventsMapperBenchmark(dd-trace-core JMH). It maps a finished single-span trace with span events and links through the v0.4, v0.5 and v1 mappers. Events are recorded throughAgentSpan.addEventwhen it exists, otherwise as the pre-encodedeventstag the OTel shim used to set, so the same source runs before and after Improve span link encoding performance #12768.dd-trace-coreperformance rules section toAGENTS.md, with matching stricter posture in theperf-reviewskill fordd-trace-coreonly:-Pjmh.profilers=gcallocation)Collections.unmodifiable*views or defensive copies returned from internal accessorsRules for other modules are unchanged: still advice, not findings.
Motivation
#12768 was titled "Improve span link encoding performance" but shipped no benchmark; only the unrelated startup SLOs ran. This measures it.
Results:
100acde503~1(before) vs100acde503(#12768),links=0,-f2 -wi5 -i5 -prof gc, JDK 21.0.4, Apple M1 Max:Spans without events are unchanged within error for every mapper.
How to read this:
eventstag back before re-encoding it natively.eventsJSON on the application thread atend(), so the "before" column excludes that work; after, the writer thread does it. Whether this is a net win for v0.4 (the default protocol) depends on the application-thread cost, which this benchmark does not measure, since the old encoder lived in the OTel shim. A follow-up benchmark through the OTel API is needed to settle that.DDSpanContext.appendJsonStringescaping the stack trace character by character; worth a look regardless.links=2, the links add 24 B/op more after than before for v0.4 and v1, and 8 B/op for v0.5. That's consistent with the per-callunmodifiableListwrapper inDDSpan.getLinks(), but not attributed with a profiler.Raw results:
results.txtfor both runs are available on request.Additional Notes
Run with:
To reproduce the before column, copy the benchmark onto
100acde503~1.Jira ticket: APMLP-2039
🤖 Generated with Claude Code