Avoid primitive boxing in v0.4 serializer#10408
Merged
Conversation
EntryIterator and EntryChangeIterator are arguably redundant
Fixed bug TagValueConversions.toBoolean Could cause LegacyTagMap.EntryReader to produce incorrect answers to some queries For simplicity, now treating Byte and Short as Integer. That will make calling code doing primitive handling simpler. Fleshing out tests -- more tests to come
Coverage for byte, short, float, and double
Updating the serializer to use TagMap traversal APIs. By using new API, the serializer is now able to avoid boxing primitives when using OptimizedTagMap.
Contributor
|
Hi! 👋 Thanks for your pull request! 🎉 To help us review it, please make sure to:
If you need help, please check our contributing guidelines. |
BenchmarksStartupParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 60 metrics, 11 unstable metrics. Startup time reports for insecure-bankgantt
title insecure-bank - global startup overhead: candidate=1.59.0-SNAPSHOT~e695a6b54e, baseline=1.59.0-SNAPSHOT~79e91742f4
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.067 s) : 0, 1067431
Total [baseline] (8.709 s) : 0, 8708531
Agent [candidate] (1.055 s) : 0, 1055012
Total [candidate] (8.687 s) : 0, 8686672
section iast
Agent [baseline] (1.227 s) : 0, 1227048
Total [baseline] (9.337 s) : 0, 9337274
Agent [candidate] (1.225 s) : 0, 1225462
Total [candidate] (9.407 s) : 0, 9407194
gantt
title insecure-bank - break down per module: candidate=1.59.0-SNAPSHOT~e695a6b54e, baseline=1.59.0-SNAPSHOT~79e91742f4
dateFormat X
axisFormat %s
section tracing
crashtracking [baseline] (1.195 ms) : 0, 1195
crashtracking [candidate] (1.177 ms) : 0, 1177
BytebuddyAgent [baseline] (628.205 ms) : 0, 628205
BytebuddyAgent [candidate] (622.428 ms) : 0, 622428
AgentMeter [baseline] (29.119 ms) : 0, 29119
AgentMeter [candidate] (28.719 ms) : 0, 28719
GlobalTracer [baseline] (258.749 ms) : 0, 258749
GlobalTracer [candidate] (257.335 ms) : 0, 257335
AppSec [baseline] (33.084 ms) : 0, 33084
AppSec [candidate] (32.953 ms) : 0, 32953
Debugger [baseline] (62.351 ms) : 0, 62351
Debugger [candidate] (63.047 ms) : 0, 63047
Remote Config [baseline] (648.178 µs) : 0, 648
Remote Config [candidate] (669.427 µs) : 0, 669
Telemetry [baseline] (10.786 ms) : 0, 10786
Telemetry [candidate] (8.925 ms) : 0, 8925
Flare Poller [baseline] (7.671 ms) : 0, 7671
Flare Poller [candidate] (4.522 ms) : 0, 4522
section iast
crashtracking [baseline] (1.19 ms) : 0, 1190
crashtracking [candidate] (1.176 ms) : 0, 1176
BytebuddyAgent [baseline] (791.475 ms) : 0, 791475
BytebuddyAgent [candidate] (789.712 ms) : 0, 789712
AgentMeter [baseline] (11.134 ms) : 0, 11134
AgentMeter [candidate] (11.133 ms) : 0, 11133
GlobalTracer [baseline] (248.406 ms) : 0, 248406
GlobalTracer [candidate] (247.985 ms) : 0, 247985
IAST [baseline] (26.921 ms) : 0, 26921
IAST [candidate] (26.852 ms) : 0, 26852
AppSec [baseline] (33.799 ms) : 0, 33799
AppSec [candidate] (34.054 ms) : 0, 34054
Debugger [baseline] (66.102 ms) : 0, 66102
Debugger [candidate] (66.474 ms) : 0, 66474
Remote Config [baseline] (554.348 µs) : 0, 554
Remote Config [candidate] (555.497 µs) : 0, 555
Telemetry [baseline] (8.545 ms) : 0, 8545
Telemetry [candidate] (8.659 ms) : 0, 8659
Flare Poller [baseline] (3.475 ms) : 0, 3475
Flare Poller [candidate] (3.527 ms) : 0, 3527
Startup time reports for petclinicgantt
title petclinic - global startup overhead: candidate=1.59.0-SNAPSHOT~e695a6b54e, baseline=1.59.0-SNAPSHOT~79e91742f4
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.063 s) : 0, 1062986
Total [baseline] (10.966 s) : 0, 10965994
Agent [candidate] (1.059 s) : 0, 1058728
Total [candidate] (10.937 s) : 0, 10936934
section appsec
Agent [baseline] (1.232 s) : 0, 1231933
Total [baseline] (11.003 s) : 0, 11002934
Agent [candidate] (1.238 s) : 0, 1238355
Total [candidate] (10.994 s) : 0, 10994269
section iast
Agent [baseline] (1.223 s) : 0, 1223355
Total [baseline] (11.122 s) : 0, 11122019
Agent [candidate] (1.232 s) : 0, 1232480
Total [candidate] (11.187 s) : 0, 11187080
section profiling
Agent [baseline] (1.189 s) : 0, 1189058
Total [baseline] (10.815 s) : 0, 10814678
Agent [candidate] (1.182 s) : 0, 1182487
Total [candidate] (10.828 s) : 0, 10827871
gantt
title petclinic - break down per module: candidate=1.59.0-SNAPSHOT~e695a6b54e, baseline=1.59.0-SNAPSHOT~79e91742f4
dateFormat X
axisFormat %s
section tracing
crashtracking [baseline] (1.193 ms) : 0, 1193
crashtracking [candidate] (1.177 ms) : 0, 1177
BytebuddyAgent [baseline] (627.67 ms) : 0, 627670
BytebuddyAgent [candidate] (624.021 ms) : 0, 624021
AgentMeter [baseline] (28.735 ms) : 0, 28735
AgentMeter [candidate] (28.694 ms) : 0, 28694
GlobalTracer [baseline] (257.243 ms) : 0, 257243
GlobalTracer [candidate] (257.852 ms) : 0, 257852
AppSec [baseline] (33.146 ms) : 0, 33146
AppSec [candidate] (32.989 ms) : 0, 32989
Debugger [baseline] (61.908 ms) : 0, 61908
Debugger [candidate] (61.105 ms) : 0, 61105
Remote Config [baseline] (645.487 µs) : 0, 645
Remote Config [candidate] (622.024 µs) : 0, 622
Telemetry [baseline] (9.99 ms) : 0, 9990
Telemetry [candidate] (9.93 ms) : 0, 9930
Flare Poller [baseline] (6.871 ms) : 0, 6871
Flare Poller [candidate] (6.86 ms) : 0, 6860
section appsec
crashtracking [baseline] (1.174 ms) : 0, 1174
crashtracking [candidate] (1.188 ms) : 0, 1188
BytebuddyAgent [baseline] (652.301 ms) : 0, 652301
BytebuddyAgent [candidate] (655.503 ms) : 0, 655503
AgentMeter [baseline] (11.824 ms) : 0, 11824
AgentMeter [candidate] (11.906 ms) : 0, 11906
GlobalTracer [baseline] (257.721 ms) : 0, 257721
GlobalTracer [candidate] (259.149 ms) : 0, 259149
IAST [baseline] (25.329 ms) : 0, 25329
IAST [candidate] (25.562 ms) : 0, 25562
AppSec [baseline] (167.092 ms) : 0, 167092
AppSec [candidate] (168.097 ms) : 0, 168097
Debugger [baseline] (67.617 ms) : 0, 67617
Debugger [candidate] (67.92 ms) : 0, 67920
Remote Config [baseline] (664.687 µs) : 0, 665
Remote Config [candidate] (686.097 µs) : 0, 686
Telemetry [baseline] (9.222 ms) : 0, 9222
Telemetry [candidate] (9.315 ms) : 0, 9315
Flare Poller [baseline] (3.625 ms) : 0, 3625
Flare Poller [candidate] (3.64 ms) : 0, 3640
section iast
crashtracking [baseline] (1.185 ms) : 0, 1185
crashtracking [candidate] (1.183 ms) : 0, 1183
BytebuddyAgent [baseline] (788.622 ms) : 0, 788622
BytebuddyAgent [candidate] (794.797 ms) : 0, 794797
AgentMeter [baseline] (11.122 ms) : 0, 11122
AgentMeter [candidate] (11.404 ms) : 0, 11404
GlobalTracer [baseline] (247.677 ms) : 0, 247677
GlobalTracer [candidate] (248.898 ms) : 0, 248898
IAST [baseline] (26.743 ms) : 0, 26743
IAST [candidate] (27.009 ms) : 0, 27009
AppSec [baseline] (32.111 ms) : 0, 32111
AppSec [candidate] (33.158 ms) : 0, 33158
Debugger [baseline] (68.108 ms) : 0, 68108
Debugger [candidate] (67.985 ms) : 0, 67985
Remote Config [baseline] (542.971 µs) : 0, 543
Remote Config [candidate] (557.823 µs) : 0, 558
Telemetry [baseline] (8.484 ms) : 0, 8484
Telemetry [candidate] (8.512 ms) : 0, 8512
Flare Poller [baseline] (3.465 ms) : 0, 3465
Flare Poller [candidate] (3.499 ms) : 0, 3499
section profiling
crashtracking [baseline] (1.214 ms) : 0, 1214
crashtracking [candidate] (1.215 ms) : 0, 1215
BytebuddyAgent [baseline] (679.517 ms) : 0, 679517
BytebuddyAgent [candidate] (674.804 ms) : 0, 674804
AgentMeter [baseline] (8.664 ms) : 0, 8664
AgentMeter [candidate] (8.583 ms) : 0, 8583
GlobalTracer [baseline] (217.382 ms) : 0, 217382
GlobalTracer [candidate] (216.141 ms) : 0, 216141
AppSec [baseline] (32.505 ms) : 0, 32505
AppSec [candidate] (32.222 ms) : 0, 32222
Debugger [baseline] (67.768 ms) : 0, 67768
Debugger [candidate] (67.573 ms) : 0, 67573
Remote Config [baseline] (594.71 µs) : 0, 595
Remote Config [candidate] (577.983 µs) : 0, 578
Telemetry [baseline] (8.696 ms) : 0, 8696
Telemetry [candidate] (8.701 ms) : 0, 8701
Flare Poller [baseline] (3.762 ms) : 0, 3762
Flare Poller [candidate] (3.784 ms) : 0, 3784
ProfilingAgent [baseline] (98.756 ms) : 0, 98756
ProfilingAgent [candidate] (99.178 ms) : 0, 99178
Profiling [baseline] (99.318 ms) : 0, 99318
Profiling [candidate] (99.753 ms) : 0, 99753
LoadParameters
See matching parameters
SummaryFound 0 performance improvements and 2 performance regressions! Performance is the same for 18 metrics, 16 unstable metrics.
Request duration reports for insecure-bankgantt
title insecure-bank - request duration [CI 0.99] : candidate=1.59.0-SNAPSHOT~e695a6b54e, baseline=1.59.0-SNAPSHOT~79e91742f4
dateFormat X
axisFormat %s
section baseline
no_agent (1.194 ms) : 1182, 1206
. : milestone, 1194,
iast (3.294 ms) : 3250, 3339
. : milestone, 3294,
iast_FULL (5.873 ms) : 5814, 5933
. : milestone, 5873,
iast_GLOBAL (3.395 ms) : 3349, 3441
. : milestone, 3395,
profiling (2.156 ms) : 2137, 2175
. : milestone, 2156,
tracing (1.816 ms) : 1800, 1833
. : milestone, 1816,
section candidate
no_agent (1.183 ms) : 1171, 1195
. : milestone, 1183,
iast (3.29 ms) : 3243, 3338
. : milestone, 3290,
iast_FULL (5.939 ms) : 5879, 5998
. : milestone, 5939,
iast_GLOBAL (3.618 ms) : 3551, 3685
. : milestone, 3618,
profiling (2.236 ms) : 2216, 2256
. : milestone, 2236,
tracing (1.82 ms) : 1805, 1836
. : milestone, 1820,
Request duration reports for petclinicgantt
title petclinic - request duration [CI 0.99] : candidate=1.59.0-SNAPSHOT~e695a6b54e, baseline=1.59.0-SNAPSHOT~79e91742f4
dateFormat X
axisFormat %s
section baseline
no_agent (19.09 ms) : 18893, 19287
. : milestone, 19090,
appsec (18.739 ms) : 18552, 18925
. : milestone, 18739,
code_origins (17.583 ms) : 17406, 17761
. : milestone, 17583,
iast (17.636 ms) : 17460, 17813
. : milestone, 17636,
profiling (18.59 ms) : 18405, 18774
. : milestone, 18590,
tracing (17.571 ms) : 17397, 17746
. : milestone, 17571,
section candidate
no_agent (19.253 ms) : 19057, 19449
. : milestone, 19253,
appsec (18.568 ms) : 18381, 18755
. : milestone, 18568,
code_origins (17.753 ms) : 17576, 17931
. : milestone, 17753,
iast (17.7 ms) : 17521, 17879
. : milestone, 17700,
profiling (19.569 ms) : 19372, 19767
. : milestone, 19569,
tracing (17.795 ms) : 17617, 17973
. : milestone, 17795,
DacapoParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 10 metrics, 2 unstable metrics. Execution time for biojavagantt
title biojava - execution time [CI 0.99] : candidate=1.59.0-SNAPSHOT~e695a6b54e, baseline=1.59.0-SNAPSHOT~79e91742f4
dateFormat X
axisFormat %s
section baseline
no_agent (15.586 s) : 15586000, 15586000
. : milestone, 15586000,
appsec (15.027 s) : 15027000, 15027000
. : milestone, 15027000,
iast (18.278 s) : 18278000, 18278000
. : milestone, 18278000,
iast_GLOBAL (18.054 s) : 18054000, 18054000
. : milestone, 18054000,
profiling (15.706 s) : 15706000, 15706000
. : milestone, 15706000,
tracing (14.805 s) : 14805000, 14805000
. : milestone, 14805000,
section candidate
no_agent (15.527 s) : 15527000, 15527000
. : milestone, 15527000,
appsec (14.755 s) : 14755000, 14755000
. : milestone, 14755000,
iast (18.116 s) : 18116000, 18116000
. : milestone, 18116000,
iast_GLOBAL (17.924 s) : 17924000, 17924000
. : milestone, 17924000,
profiling (14.866 s) : 14866000, 14866000
. : milestone, 14866000,
tracing (14.774 s) : 14774000, 14774000
. : milestone, 14774000,
Execution time for tomcatgantt
title tomcat - execution time [CI 0.99] : candidate=1.59.0-SNAPSHOT~e695a6b54e, baseline=1.59.0-SNAPSHOT~79e91742f4
dateFormat X
axisFormat %s
section baseline
no_agent (1.48 ms) : 1468, 1491
. : milestone, 1480,
appsec (3.719 ms) : 3500, 3937
. : milestone, 3719,
iast (2.269 ms) : 2199, 2338
. : milestone, 2269,
iast_GLOBAL (2.304 ms) : 2234, 2374
. : milestone, 2304,
profiling (2.518 ms) : 2351, 2684
. : milestone, 2518,
tracing (2.073 ms) : 2019, 2126
. : milestone, 2073,
section candidate
no_agent (1.475 ms) : 1463, 1486
. : milestone, 1475,
appsec (3.78 ms) : 3557, 4003
. : milestone, 3780,
iast (2.265 ms) : 2196, 2335
. : milestone, 2265,
iast_GLOBAL (2.306 ms) : 2236, 2376
. : milestone, 2306,
profiling (2.111 ms) : 2054, 2167
. : milestone, 2111,
tracing (2.078 ms) : 2024, 2132
. : milestone, 2078,
|
bric3
approved these changes
Jan 21, 2026
dd-trace-core/src/main/java/datadog/trace/common/writer/ddagent/TraceMapperV0_4.java
Outdated
Show resolved
Hide resolved
Contributor
|
@codex review |
|
To use Codex here, create a Codex account and connect to github. |
…d-trace-java into dougqh/v4-serializer-no-boxing
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
Updates V0.4 serializer to use TagMap.EntryReader API to avoid boxing primitives
Motivation
Reduce allocation -> reduces garbage collection -> improves throughput predictability
Additional Notes
Builds on EntryReader API changes
Contributor Checklist
type:and (comp:orinst:) labels in addition to any useful labelsclose,fixor any linking keywords when referencing an issue.Use
solvesinstead, and assign the PR milestone to the issueJira ticket: [PROJ-IDENT]