Open
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
Adding methods to AgentSpan / DDSpan that take TagMap.Entry/Reader objects directly This will enable TagMap.Entry reuse which can reduce memory allocation/GC pressure
Methods are intended to be used to create TagMap.Entry objects for repeatedly used values Overloads are provided for all the supported types to be easier for developers not familiar with TagMap internals. Internally, TagMap still uses the more explicit new<X>Entry methods.
Removing statics that were previously moved to TagValueConversions
- tests exposed missing TagMap.Entry.create for boolean - added explanatory strings to some asserts
…aDog/dd-trace-java into dougqh/fdirect-apis-for-tagmap-entry
dougqh
commented
Feb 2, 2026
| @@ -1,22 +1,34 @@ | |||
| package datadog.trace.bootstrap.instrumentation.decorator; | |||
|
|
|||
| import datadog.trace.api.TagMap; | |||
Contributor
Author
There was a problem hiding this comment.
This change is based off of https://github.com/DataDog/dd-trace-java/pull/10472/changes which I plan to merge before this PR
The only real change in this PR is this file: ClientDecorator
BenchmarksStartupParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 63 metrics, 8 unstable metrics. Startup time reports for petclinicgantt
title petclinic - global startup overhead: candidate=1.59.0-SNAPSHOT~aa1f66bf39, baseline=1.59.0-SNAPSHOT~76b5b63bcb
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.057 s) : 0, 1056739
Total [baseline] (10.912 s) : 0, 10912185
Agent [candidate] (1.067 s) : 0, 1066780
Total [candidate] (10.906 s) : 0, 10906228
section appsec
Agent [baseline] (1.238 s) : 0, 1238236
Total [baseline] (10.892 s) : 0, 10892234
Agent [candidate] (1.229 s) : 0, 1229260
Total [candidate] (10.86 s) : 0, 10860078
section iast
Agent [baseline] (1.234 s) : 0, 1233993
Total [baseline] (11.167 s) : 0, 11166539
Agent [candidate] (1.23 s) : 0, 1229750
Total [candidate] (11.162 s) : 0, 11162127
section profiling
Agent [baseline] (1.186 s) : 0, 1186208
Total [baseline] (10.946 s) : 0, 10945853
Agent [candidate] (1.186 s) : 0, 1185809
Total [candidate] (10.944 s) : 0, 10943976
gantt
title petclinic - break down per module: candidate=1.59.0-SNAPSHOT~aa1f66bf39, baseline=1.59.0-SNAPSHOT~76b5b63bcb
dateFormat X
axisFormat %s
section tracing
crashtracking [baseline] (1.173 ms) : 0, 1173
crashtracking [candidate] (1.189 ms) : 0, 1189
BytebuddyAgent [baseline] (622.676 ms) : 0, 622676
BytebuddyAgent [candidate] (627.726 ms) : 0, 627726
AgentMeter [baseline] (28.697 ms) : 0, 28697
AgentMeter [candidate] (28.899 ms) : 0, 28899
GlobalTracer [baseline] (256.539 ms) : 0, 256539
GlobalTracer [candidate] (258.637 ms) : 0, 258637
AppSec [baseline] (32.908 ms) : 0, 32908
AppSec [candidate] (33.208 ms) : 0, 33208
Debugger [baseline] (61.081 ms) : 0, 61081
Debugger [candidate] (63.25 ms) : 0, 63250
Remote Config [baseline] (622.205 µs) : 0, 622
Remote Config [candidate] (615.4 µs) : 0, 615
Telemetry [baseline] (10.741 ms) : 0, 10741
Telemetry [candidate] (10.811 ms) : 0, 10811
Flare Poller [baseline] (6.874 ms) : 0, 6874
Flare Poller [candidate] (6.865 ms) : 0, 6865
section appsec
crashtracking [baseline] (1.198 ms) : 0, 1198
crashtracking [candidate] (1.187 ms) : 0, 1187
BytebuddyAgent [baseline] (656.848 ms) : 0, 656848
BytebuddyAgent [candidate] (650.722 ms) : 0, 650722
AgentMeter [baseline] (11.875 ms) : 0, 11875
AgentMeter [candidate] (11.856 ms) : 0, 11856
GlobalTracer [baseline] (258.662 ms) : 0, 258662
GlobalTracer [candidate] (257.122 ms) : 0, 257122
IAST [baseline] (25.526 ms) : 0, 25526
IAST [candidate] (25.411 ms) : 0, 25411
AppSec [baseline] (167.451 ms) : 0, 167451
AppSec [candidate] (166.925 ms) : 0, 166925
Debugger [baseline] (67.828 ms) : 0, 67828
Debugger [candidate] (67.359 ms) : 0, 67359
Remote Config [baseline] (654.71 µs) : 0, 655
Remote Config [candidate] (647.337 µs) : 0, 647
Telemetry [baseline] (9.183 ms) : 0, 9183
Telemetry [candidate] (9.215 ms) : 0, 9215
Flare Poller [baseline] (3.618 ms) : 0, 3618
Flare Poller [candidate] (3.604 ms) : 0, 3604
section iast
crashtracking [baseline] (1.196 ms) : 0, 1196
crashtracking [candidate] (1.191 ms) : 0, 1191
BytebuddyAgent [baseline] (794.724 ms) : 0, 794724
BytebuddyAgent [candidate] (793.218 ms) : 0, 793218
AgentMeter [baseline] (11.325 ms) : 0, 11325
AgentMeter [candidate] (11.251 ms) : 0, 11251
GlobalTracer [baseline] (249.699 ms) : 0, 249699
GlobalTracer [candidate] (248.891 ms) : 0, 248891
IAST [baseline] (27.124 ms) : 0, 27124
IAST [candidate] (26.794 ms) : 0, 26794
AppSec [baseline] (35.069 ms) : 0, 35069
AppSec [candidate] (34.465 ms) : 0, 34465
Debugger [baseline] (66.886 ms) : 0, 66886
Debugger [candidate] (65.922 ms) : 0, 65922
Remote Config [baseline] (546.345 µs) : 0, 546
Remote Config [candidate] (555.956 µs) : 0, 556
Telemetry [baseline] (8.498 ms) : 0, 8498
Telemetry [candidate] (8.64 ms) : 0, 8640
Flare Poller [baseline] (3.484 ms) : 0, 3484
Flare Poller [candidate] (3.517 ms) : 0, 3517
section profiling
crashtracking [baseline] (1.211 ms) : 0, 1211
crashtracking [candidate] (1.209 ms) : 0, 1209
BytebuddyAgent [baseline] (676.861 ms) : 0, 676861
BytebuddyAgent [candidate] (677.553 ms) : 0, 677553
AgentMeter [baseline] (8.641 ms) : 0, 8641
AgentMeter [candidate] (8.601 ms) : 0, 8601
GlobalTracer [baseline] (216.477 ms) : 0, 216477
GlobalTracer [candidate] (216.719 ms) : 0, 216719
AppSec [baseline] (32.39 ms) : 0, 32390
AppSec [candidate] (32.39 ms) : 0, 32390
Debugger [baseline] (67.569 ms) : 0, 67569
Debugger [candidate] (67.687 ms) : 0, 67687
Remote Config [baseline] (586.51 µs) : 0, 587
Remote Config [candidate] (592.62 µs) : 0, 593
Telemetry [baseline] (8.749 ms) : 0, 8749
Telemetry [candidate] (8.722 ms) : 0, 8722
Flare Poller [baseline] (3.813 ms) : 0, 3813
Flare Poller [candidate] (3.724 ms) : 0, 3724
ProfilingAgent [baseline] (99.948 ms) : 0, 99948
ProfilingAgent [candidate] (98.802 ms) : 0, 98802
Profiling [baseline] (100.527 ms) : 0, 100527
Profiling [candidate] (99.377 ms) : 0, 99377
Startup time reports for insecure-bankgantt
title insecure-bank - global startup overhead: candidate=1.59.0-SNAPSHOT~aa1f66bf39, baseline=1.59.0-SNAPSHOT~76b5b63bcb
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.058 s) : 0, 1057794
Total [baseline] (8.682 s) : 0, 8682456
Agent [candidate] (1.069 s) : 0, 1068736
Total [candidate] (8.723 s) : 0, 8723058
section iast
Agent [baseline] (1.226 s) : 0, 1225591
Total [baseline] (9.355 s) : 0, 9354802
Agent [candidate] (1.232 s) : 0, 1232108
Total [candidate] (9.358 s) : 0, 9358354
gantt
title insecure-bank - break down per module: candidate=1.59.0-SNAPSHOT~aa1f66bf39, baseline=1.59.0-SNAPSHOT~76b5b63bcb
dateFormat X
axisFormat %s
section tracing
crashtracking [baseline] (1.181 ms) : 0, 1181
crashtracking [candidate] (1.19 ms) : 0, 1190
BytebuddyAgent [baseline] (622.518 ms) : 0, 622518
BytebuddyAgent [candidate] (631.662 ms) : 0, 631662
AgentMeter [baseline] (28.795 ms) : 0, 28795
AgentMeter [candidate] (29.088 ms) : 0, 29088
GlobalTracer [baseline] (256.746 ms) : 0, 256746
GlobalTracer [candidate] (259.485 ms) : 0, 259485
AppSec [baseline] (32.838 ms) : 0, 32838
AppSec [candidate] (33.258 ms) : 0, 33258
Debugger [baseline] (61.316 ms) : 0, 61316
Debugger [candidate] (62.247 ms) : 0, 62247
Remote Config [baseline] (614.215 µs) : 0, 614
Remote Config [candidate] (616.085 µs) : 0, 616
Telemetry [baseline] (9.021 ms) : 0, 9021
Telemetry [candidate] (10.12 ms) : 0, 10120
Flare Poller [baseline] (9.283 ms) : 0, 9283
Flare Poller [candidate] (5.438 ms) : 0, 5438
section iast
crashtracking [baseline] (1.191 ms) : 0, 1191
crashtracking [candidate] (1.183 ms) : 0, 1183
BytebuddyAgent [baseline] (790.099 ms) : 0, 790099
BytebuddyAgent [candidate] (796.283 ms) : 0, 796283
AgentMeter [baseline] (11.239 ms) : 0, 11239
AgentMeter [candidate] (11.289 ms) : 0, 11289
GlobalTracer [baseline] (248.161 ms) : 0, 248161
GlobalTracer [candidate] (249.233 ms) : 0, 249233
IAST [baseline] (26.948 ms) : 0, 26948
IAST [candidate] (26.966 ms) : 0, 26966
AppSec [baseline] (34.717 ms) : 0, 34717
AppSec [candidate] (32.111 ms) : 0, 32111
Debugger [baseline] (65.123 ms) : 0, 65123
Debugger [candidate] (67.209 ms) : 0, 67209
Remote Config [baseline] (551.339 µs) : 0, 551
Remote Config [candidate] (537.605 µs) : 0, 538
Telemetry [baseline] (8.626 ms) : 0, 8626
Telemetry [candidate] (8.438 ms) : 0, 8438
Flare Poller [baseline] (3.541 ms) : 0, 3541
Flare Poller [candidate] (3.468 ms) : 0, 3468
LoadParameters
See matching parameters
SummaryFound 3 performance improvements and 2 performance regressions! Performance is the same for 15 metrics, 16 unstable metrics.
Request duration reports for insecure-bankgantt
title insecure-bank - request duration [CI 0.99] : candidate=1.59.0-SNAPSHOT~aa1f66bf39, baseline=1.59.0-SNAPSHOT~76b5b63bcb
dateFormat X
axisFormat %s
section baseline
no_agent (1.189 ms) : 1176, 1202
. : milestone, 1189,
iast (3.173 ms) : 3130, 3217
. : milestone, 3173,
iast_FULL (6.176 ms) : 6112, 6239
. : milestone, 6176,
iast_GLOBAL (3.64 ms) : 3574, 3706
. : milestone, 3640,
profiling (2.336 ms) : 2314, 2358
. : milestone, 2336,
tracing (1.791 ms) : 1776, 1805
. : milestone, 1791,
section candidate
no_agent (1.19 ms) : 1178, 1202
. : milestone, 1190,
iast (3.242 ms) : 3200, 3285
. : milestone, 3242,
iast_FULL (5.718 ms) : 5662, 5775
. : milestone, 5718,
iast_GLOBAL (3.757 ms) : 3688, 3826
. : milestone, 3757,
profiling (2.153 ms) : 2133, 2174
. : milestone, 2153,
tracing (1.815 ms) : 1800, 1830
. : milestone, 1815,
Request duration reports for petclinicgantt
title petclinic - request duration [CI 0.99] : candidate=1.59.0-SNAPSHOT~aa1f66bf39, baseline=1.59.0-SNAPSHOT~76b5b63bcb
dateFormat X
axisFormat %s
section baseline
no_agent (18.123 ms) : 17942, 18303
. : milestone, 18123,
appsec (18.802 ms) : 18611, 18993
. : milestone, 18802,
code_origins (18.057 ms) : 17874, 18240
. : milestone, 18057,
iast (17.434 ms) : 17263, 17604
. : milestone, 17434,
profiling (19.685 ms) : 19486, 19884
. : milestone, 19685,
tracing (17.808 ms) : 17632, 17984
. : milestone, 17808,
section candidate
no_agent (18.036 ms) : 17847, 18225
. : milestone, 18036,
appsec (18.903 ms) : 18711, 19095
. : milestone, 18903,
code_origins (17.705 ms) : 17529, 17882
. : milestone, 17705,
iast (18.788 ms) : 18601, 18976
. : milestone, 18788,
profiling (18.505 ms) : 18324, 18687
. : milestone, 18505,
tracing (18.206 ms) : 18022, 18389
. : milestone, 18206,
DacapoParameters
See matching parameters
SummaryFound 1 performance improvements and 0 performance regressions! Performance is the same for 11 metrics, 0 unstable metrics.
Execution time for biojavagantt
title biojava - execution time [CI 0.99] : candidate=1.59.0-SNAPSHOT~aa1f66bf39, baseline=1.59.0-SNAPSHOT~76b5b63bcb
dateFormat X
axisFormat %s
section baseline
no_agent (15.019 s) : 15019000, 15019000
. : milestone, 15019000,
appsec (15.117 s) : 15117000, 15117000
. : milestone, 15117000,
iast (17.847 s) : 17847000, 17847000
. : milestone, 17847000,
iast_GLOBAL (17.503 s) : 17503000, 17503000
. : milestone, 17503000,
profiling (14.986 s) : 14986000, 14986000
. : milestone, 14986000,
tracing (14.654 s) : 14654000, 14654000
. : milestone, 14654000,
section candidate
no_agent (15.536 s) : 15536000, 15536000
. : milestone, 15536000,
appsec (15.107 s) : 15107000, 15107000
. : milestone, 15107000,
iast (18.206 s) : 18206000, 18206000
. : milestone, 18206000,
iast_GLOBAL (17.677 s) : 17677000, 17677000
. : milestone, 17677000,
profiling (15.047 s) : 15047000, 15047000
. : milestone, 15047000,
tracing (14.704 s) : 14704000, 14704000
. : milestone, 14704000,
Execution time for tomcatgantt
title tomcat - execution time [CI 0.99] : candidate=1.59.0-SNAPSHOT~aa1f66bf39, baseline=1.59.0-SNAPSHOT~76b5b63bcb
dateFormat X
axisFormat %s
section baseline
no_agent (1.473 ms) : 1462, 1485
. : milestone, 1473,
appsec (3.757 ms) : 3535, 3978
. : milestone, 3757,
iast (2.25 ms) : 2180, 2319
. : milestone, 2250,
iast_GLOBAL (2.291 ms) : 2222, 2361
. : milestone, 2291,
profiling (2.115 ms) : 2058, 2172
. : milestone, 2115,
tracing (2.058 ms) : 2004, 2111
. : milestone, 2058,
section candidate
no_agent (1.471 ms) : 1460, 1483
. : milestone, 1471,
appsec (2.493 ms) : 2438, 2548
. : milestone, 2493,
iast (2.253 ms) : 2184, 2322
. : milestone, 2253,
iast_GLOBAL (2.295 ms) : 2225, 2365
. : milestone, 2295,
profiling (2.067 ms) : 2013, 2122
. : milestone, 2067,
tracing (2.059 ms) : 2006, 2113
. : milestone, 2059,
|
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
Caches & reuses SpanKind Entry in ClientDecorator
Motivation
Reduce allocation & garbage collection - improves throughput under load
Additional Notes
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]