Conversation
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.61.0-SNAPSHOT~2275e716e1, baseline=1.62.0-SNAPSHOT~6880c80c48
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.058 s) : 0, 1058214
Total [baseline] (8.841 s) : 0, 8841355
Agent [candidate] (1.064 s) : 0, 1063648
Total [candidate] (8.846 s) : 0, 8846284
section iast
Agent [baseline] (1.228 s) : 0, 1227750
Total [baseline] (9.541 s) : 0, 9540853
Agent [candidate] (1.231 s) : 0, 1231489
Total [candidate] (9.616 s) : 0, 9615950
gantt
title insecure-bank - break down per module: candidate=1.61.0-SNAPSHOT~2275e716e1, baseline=1.62.0-SNAPSHOT~6880c80c48
dateFormat X
axisFormat %s
section tracing
crashtracking [baseline] (1.262 ms) : 0, 1262
crashtracking [candidate] (1.232 ms) : 0, 1232
BytebuddyAgent [baseline] (634.756 ms) : 0, 634756
BytebuddyAgent [candidate] (638.805 ms) : 0, 638805
AgentMeter [baseline] (29.519 ms) : 0, 29519
AgentMeter [candidate] (29.615 ms) : 0, 29615
GlobalTracer [baseline] (248.27 ms) : 0, 248270
GlobalTracer [candidate] (249.201 ms) : 0, 249201
AppSec [baseline] (32.4 ms) : 0, 32400
AppSec [candidate] (32.267 ms) : 0, 32267
Debugger [baseline] (58.877 ms) : 0, 58877
Debugger [candidate] (59.347 ms) : 0, 59347
Remote Config [baseline] (596.8 µs) : 0, 597
Remote Config [candidate] (611.304 µs) : 0, 611
Telemetry [baseline] (7.969 ms) : 0, 7969
Telemetry [candidate] (9.457 ms) : 0, 9457
Flare Poller [baseline] (8.194 ms) : 0, 8194
Flare Poller [candidate] (6.694 ms) : 0, 6694
section iast
crashtracking [baseline] (1.261 ms) : 0, 1261
crashtracking [candidate] (1.234 ms) : 0, 1234
BytebuddyAgent [baseline] (807.307 ms) : 0, 807307
BytebuddyAgent [candidate] (808.75 ms) : 0, 808750
AgentMeter [baseline] (11.348 ms) : 0, 11348
AgentMeter [candidate] (11.393 ms) : 0, 11393
GlobalTracer [baseline] (238.216 ms) : 0, 238216
GlobalTracer [candidate] (238.837 ms) : 0, 238837
IAST [baseline] (30.936 ms) : 0, 30936
IAST [candidate] (29.91 ms) : 0, 29910
AppSec [baseline] (27.223 ms) : 0, 27223
AppSec [candidate] (26.949 ms) : 0, 26949
Debugger [baseline] (63.725 ms) : 0, 63725
Debugger [candidate] (66.391 ms) : 0, 66391
Remote Config [baseline] (526.844 µs) : 0, 527
Remote Config [candidate] (535.657 µs) : 0, 536
Telemetry [baseline] (7.696 ms) : 0, 7696
Telemetry [candidate] (7.981 ms) : 0, 7981
Flare Poller [baseline] (3.396 ms) : 0, 3396
Flare Poller [candidate] (3.485 ms) : 0, 3485
Startup time reports for petclinicgantt
title petclinic - global startup overhead: candidate=1.61.0-SNAPSHOT~2275e716e1, baseline=1.62.0-SNAPSHOT~6880c80c48
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.058 s) : 0, 1058191
Total [baseline] (11.143 s) : 0, 11143328
Agent [candidate] (1.058 s) : 0, 1057872
Total [candidate] (11.173 s) : 0, 11173081
section appsec
Agent [baseline] (1.261 s) : 0, 1260563
Total [baseline] (11.006 s) : 0, 11005919
Agent [candidate] (1.271 s) : 0, 1271223
Total [candidate] (11.138 s) : 0, 11138007
section iast
Agent [baseline] (1.23 s) : 0, 1230168
Total [baseline] (11.314 s) : 0, 11313975
Agent [candidate] (1.233 s) : 0, 1232713
Total [candidate] (11.283 s) : 0, 11283373
section profiling
Agent [baseline] (1.186 s) : 0, 1186026
Total [baseline] (11.165 s) : 0, 11165185
Agent [candidate] (1.185 s) : 0, 1185157
Total [candidate] (11.063 s) : 0, 11063218
gantt
title petclinic - break down per module: candidate=1.61.0-SNAPSHOT~2275e716e1, baseline=1.62.0-SNAPSHOT~6880c80c48
dateFormat X
axisFormat %s
section tracing
crashtracking [baseline] (1.241 ms) : 0, 1241
crashtracking [candidate] (1.235 ms) : 0, 1235
BytebuddyAgent [baseline] (632.869 ms) : 0, 632869
BytebuddyAgent [candidate] (631.818 ms) : 0, 631818
AgentMeter [baseline] (29.579 ms) : 0, 29579
AgentMeter [candidate] (29.262 ms) : 0, 29262
GlobalTracer [baseline] (249.842 ms) : 0, 249842
GlobalTracer [candidate] (249.385 ms) : 0, 249385
AppSec [baseline] (32.612 ms) : 0, 32612
AppSec [candidate] (32.321 ms) : 0, 32321
Debugger [baseline] (60.124 ms) : 0, 60124
Debugger [candidate] (60.634 ms) : 0, 60634
Remote Config [baseline] (613.227 µs) : 0, 613
Remote Config [candidate] (604.266 µs) : 0, 604
Telemetry [baseline] (8.142 ms) : 0, 8142
Telemetry [candidate] (8.845 ms) : 0, 8845
Flare Poller [baseline] (6.794 ms) : 0, 6794
Flare Poller [candidate] (7.632 ms) : 0, 7632
section appsec
crashtracking [baseline] (1.235 ms) : 0, 1235
crashtracking [candidate] (1.253 ms) : 0, 1253
BytebuddyAgent [baseline] (673.574 ms) : 0, 673574
BytebuddyAgent [candidate] (680.523 ms) : 0, 680523
AgentMeter [baseline] (12.181 ms) : 0, 12181
AgentMeter [candidate] (12.391 ms) : 0, 12391
GlobalTracer [baseline] (248.91 ms) : 0, 248910
GlobalTracer [candidate] (250.637 ms) : 0, 250637
AppSec [baseline] (186.403 ms) : 0, 186403
AppSec [candidate] (187.48 ms) : 0, 187480
Debugger [baseline] (65.664 ms) : 0, 65664
Debugger [candidate] (65.973 ms) : 0, 65973
Remote Config [baseline] (574.429 µs) : 0, 574
Remote Config [candidate] (574.197 µs) : 0, 574
Telemetry [baseline] (7.852 ms) : 0, 7852
Telemetry [candidate] (7.86 ms) : 0, 7860
Flare Poller [baseline] (3.465 ms) : 0, 3465
Flare Poller [candidate] (3.46 ms) : 0, 3460
IAST [baseline] (24.297 ms) : 0, 24297
IAST [candidate] (24.464 ms) : 0, 24464
section iast
crashtracking [baseline] (1.244 ms) : 0, 1244
crashtracking [candidate] (1.225 ms) : 0, 1225
BytebuddyAgent [baseline] (807.802 ms) : 0, 807802
BytebuddyAgent [candidate] (808.895 ms) : 0, 808895
AgentMeter [baseline] (11.391 ms) : 0, 11391
AgentMeter [candidate] (11.394 ms) : 0, 11394
GlobalTracer [baseline] (238.717 ms) : 0, 238717
GlobalTracer [candidate] (239.703 ms) : 0, 239703
AppSec [baseline] (29.229 ms) : 0, 29229
AppSec [candidate] (28.514 ms) : 0, 28514
Debugger [baseline] (64.068 ms) : 0, 64068
Debugger [candidate] (64.206 ms) : 0, 64206
Remote Config [baseline] (543.563 µs) : 0, 544
Remote Config [candidate] (539.608 µs) : 0, 540
Telemetry [baseline] (7.813 ms) : 0, 7813
Telemetry [candidate] (7.886 ms) : 0, 7886
Flare Poller [baseline] (3.431 ms) : 0, 3431
Flare Poller [candidate] (3.478 ms) : 0, 3478
IAST [baseline] (29.058 ms) : 0, 29058
IAST [candidate] (30.853 ms) : 0, 30853
section profiling
ProfilingAgent [baseline] (94.28 ms) : 0, 94280
ProfilingAgent [candidate] (93.881 ms) : 0, 93881
crashtracking [baseline] (1.185 ms) : 0, 1185
crashtracking [candidate] (1.187 ms) : 0, 1187
BytebuddyAgent [baseline] (691.4 ms) : 0, 691400
BytebuddyAgent [candidate] (691.399 ms) : 0, 691399
AgentMeter [baseline] (9.234 ms) : 0, 9234
AgentMeter [candidate] (9.271 ms) : 0, 9271
GlobalTracer [baseline] (207.386 ms) : 0, 207386
GlobalTracer [candidate] (207.232 ms) : 0, 207232
AppSec [baseline] (32.919 ms) : 0, 32919
AppSec [candidate] (32.761 ms) : 0, 32761
Debugger [baseline] (66.267 ms) : 0, 66267
Debugger [candidate] (65.843 ms) : 0, 65843
Remote Config [baseline] (584.558 µs) : 0, 585
Remote Config [candidate] (573.624 µs) : 0, 574
Telemetry [baseline] (7.783 ms) : 0, 7783
Telemetry [candidate] (7.822 ms) : 0, 7822
Flare Poller [baseline] (3.536 ms) : 0, 3536
Flare Poller [candidate] (3.592 ms) : 0, 3592
Profiling [baseline] (94.843 ms) : 0, 94843
Profiling [candidate] (94.439 ms) : 0, 94439
LoadParameters
See matching parameters
SummaryFound 1 performance improvements and 3 performance regressions! Performance is the same for 16 metrics, 16 unstable metrics.
Request duration reports for petclinicgantt
title petclinic - request duration [CI 0.99] : candidate=1.61.0-SNAPSHOT~2275e716e1, baseline=1.62.0-SNAPSHOT~6880c80c48
dateFormat X
axisFormat %s
section baseline
no_agent (19.093 ms) : 18898, 19289
. : milestone, 19093,
appsec (18.794 ms) : 18603, 18984
. : milestone, 18794,
code_origins (17.802 ms) : 17625, 17980
. : milestone, 17802,
iast (17.853 ms) : 17676, 18030
. : milestone, 17853,
profiling (18.346 ms) : 18162, 18530
. : milestone, 18346,
tracing (17.789 ms) : 17615, 17963
. : milestone, 17789,
section candidate
no_agent (18.03 ms) : 17850, 18211
. : milestone, 18030,
appsec (18.774 ms) : 18587, 18962
. : milestone, 18774,
code_origins (17.968 ms) : 17789, 18147
. : milestone, 17968,
iast (17.88 ms) : 17701, 18058
. : milestone, 17880,
profiling (18.283 ms) : 18104, 18461
. : milestone, 18283,
tracing (18.729 ms) : 18541, 18916
. : milestone, 18729,
Request duration reports for insecure-bankgantt
title insecure-bank - request duration [CI 0.99] : candidate=1.61.0-SNAPSHOT~2275e716e1, baseline=1.62.0-SNAPSHOT~6880c80c48
dateFormat X
axisFormat %s
section baseline
no_agent (1.256 ms) : 1243, 1269
. : milestone, 1256,
iast (3.272 ms) : 3225, 3320
. : milestone, 3272,
iast_FULL (5.79 ms) : 5731, 5848
. : milestone, 5790,
iast_GLOBAL (3.538 ms) : 3479, 3596
. : milestone, 3538,
profiling (2.135 ms) : 2112, 2158
. : milestone, 2135,
tracing (1.932 ms) : 1915, 1949
. : milestone, 1932,
section candidate
no_agent (1.236 ms) : 1224, 1247
. : milestone, 1236,
iast (3.211 ms) : 3169, 3253
. : milestone, 3211,
iast_FULL (5.958 ms) : 5898, 6019
. : milestone, 5958,
iast_GLOBAL (3.74 ms) : 3678, 3801
. : milestone, 3740,
profiling (2.095 ms) : 2076, 2113
. : milestone, 2095,
tracing (1.899 ms) : 1883, 1914
. : milestone, 1899,
DacapoParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 11 metrics, 1 unstable metrics. Execution time for biojavagantt
title biojava - execution time [CI 0.99] : candidate=1.61.0-SNAPSHOT~2275e716e1, baseline=1.62.0-SNAPSHOT~6880c80c48
dateFormat X
axisFormat %s
section baseline
no_agent (15.704 s) : 15704000, 15704000
. : milestone, 15704000,
appsec (14.656 s) : 14656000, 14656000
. : milestone, 14656000,
iast (18.731 s) : 18731000, 18731000
. : milestone, 18731000,
iast_GLOBAL (18.092 s) : 18092000, 18092000
. : milestone, 18092000,
profiling (14.914 s) : 14914000, 14914000
. : milestone, 14914000,
tracing (14.799 s) : 14799000, 14799000
. : milestone, 14799000,
section candidate
no_agent (15.528 s) : 15528000, 15528000
. : milestone, 15528000,
appsec (14.972 s) : 14972000, 14972000
. : milestone, 14972000,
iast (18.584 s) : 18584000, 18584000
. : milestone, 18584000,
iast_GLOBAL (17.99 s) : 17990000, 17990000
. : milestone, 17990000,
profiling (15.313 s) : 15313000, 15313000
. : milestone, 15313000,
tracing (14.939 s) : 14939000, 14939000
. : milestone, 14939000,
Execution time for tomcatgantt
title tomcat - execution time [CI 0.99] : candidate=1.61.0-SNAPSHOT~2275e716e1, baseline=1.62.0-SNAPSHOT~6880c80c48
dateFormat X
axisFormat %s
section baseline
no_agent (1.49 ms) : 1478, 1502
. : milestone, 1490,
appsec (3.811 ms) : 3589, 4033
. : milestone, 3811,
iast (2.277 ms) : 2207, 2346
. : milestone, 2277,
iast_GLOBAL (2.323 ms) : 2252, 2393
. : milestone, 2323,
profiling (2.09 ms) : 2035, 2144
. : milestone, 2090,
tracing (2.074 ms) : 2021, 2128
. : milestone, 2074,
section candidate
no_agent (1.486 ms) : 1474, 1498
. : milestone, 1486,
appsec (3.838 ms) : 3616, 4061
. : milestone, 3838,
iast (2.269 ms) : 2200, 2339
. : milestone, 2269,
iast_GLOBAL (2.315 ms) : 2245, 2385
. : milestone, 2315,
profiling (2.11 ms) : 2055, 2165
. : milestone, 2110,
tracing (2.072 ms) : 2018, 2125
. : milestone, 2072,
|
|
Besides just reviewing the code, I wanted to see how this change impacts our overhead.
I suspect throughput will improve once this branch is synchronized with master. The cache will just help a little more by de-duplicating across payloads. |
Yep, totally agree on caching, we can improve in follow up PRs. |
dougqh
left a comment
There was a problem hiding this comment.
One other performance suggestion from Claude...
- StringTable lookups force String materialization and Integer boxing — TraceMapperV1.java:1695-1706, :1832-1866
Every tag name, tag value, service name, operation name, resource, component, etc. goes through:
String str = value == null ? "" : value.toString();
Integer index = stringTable.get(str);
Two issues:
- value.toString() allocates a new String for every UTF8BytesString / non-String CharSequence. Given V1 is a streaming string table design intended to amortize
string cost, this re-materializes on every lookup and defeats part of the win.- HashMap<String,Integer>.get() autoboxes the returned index.
Consider a CharSequence-keyed open-addressed primitive int map (dd-trace already has UTF8ByteStringMap-like structures; verify). Even dropping to Eclipse
Collections' ObjectIntHashMap gets rid of boxing.
I'm guess StringTable is pre-existing. I agree with Claude that it would be nice to reduce the allocation especially the boxing.
But again, I'm fine with leaving this to a later PR.
dougqh
left a comment
There was a problem hiding this comment.
Looks good to me.
I added a couple comments based on asking Claude to do a perf review.
I do think optimizing might the ID to byte conversion would be good.
I suspect that is where some (most?) of the extra 2GiB of byte[] were coming from.
But I'm fine with doing that in a separate pull request
# Conflicts: # dd-trace-core/src/main/java/datadog/trace/core/DDSpanContext.java
What Does This Do
Implements support for the Datadog Agent Trace Protocol
v1.0(v1.0/tracesendpoint) in the Java tracer.Introduces
TraceMapperV1, a new serializer that encodes traces in thev1 msgpackformat with a flat attribute model, string table deduplication, and typed attribute values.Adds a
ProtocolVersionenum to cleanly representv0.4,v0.5, andv1.0protocols including their fallback endpoint chains.Updates
DDAgentFeaturesDiscoveryto probe endpoints based on the configured protocol version.Motivation
Protocol v1 is a more efficient wire format: it deduplicates repeated strings via a string table, uses typed attribute values (string/bool/float/int/bytes/array). This reduces payload size and provides a cleaner foundation for future span model evolution. The implementation falls back gracefully to
v0.4when the agent does not advertisev1support.Additional Notes
Protocol v1 spec
System test passed both on GitHub and GitLab.