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~9a502fa3cf, baseline=1.62.0-SNAPSHOT~071ce9dae5
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.062 s) : 0, 1061998
Total [baseline] (8.822 s) : 0, 8822477
Agent [candidate] (1.066 s) : 0, 1066241
Total [candidate] (8.858 s) : 0, 8857619
section iast
Agent [baseline] (1.227 s) : 0, 1226887
Total [baseline] (9.569 s) : 0, 9569045
Agent [candidate] (1.225 s) : 0, 1224735
Total [candidate] (9.581 s) : 0, 9580587
gantt
title insecure-bank - break down per module: candidate=1.61.0-SNAPSHOT~9a502fa3cf, baseline=1.62.0-SNAPSHOT~071ce9dae5
dateFormat X
axisFormat %s
section tracing
crashtracking [baseline] (1.259 ms) : 0, 1259
crashtracking [candidate] (1.243 ms) : 0, 1243
BytebuddyAgent [baseline] (636.391 ms) : 0, 636391
BytebuddyAgent [candidate] (638.652 ms) : 0, 638652
AgentMeter [baseline] (29.646 ms) : 0, 29646
AgentMeter [candidate] (29.561 ms) : 0, 29561
GlobalTracer [baseline] (249.141 ms) : 0, 249141
GlobalTracer [candidate] (250.286 ms) : 0, 250286
AppSec [baseline] (32.418 ms) : 0, 32418
AppSec [candidate] (32.443 ms) : 0, 32443
Debugger [baseline] (59.274 ms) : 0, 59274
Debugger [candidate] (59.514 ms) : 0, 59514
Remote Config [baseline] (589.809 µs) : 0, 590
Remote Config [candidate] (597.107 µs) : 0, 597
Telemetry [baseline] (8.03 ms) : 0, 8030
Telemetry [candidate] (8.28 ms) : 0, 8280
Flare Poller [baseline] (9.03 ms) : 0, 9030
Flare Poller [candidate] (9.097 ms) : 0, 9097
section iast
crashtracking [baseline] (1.247 ms) : 0, 1247
crashtracking [candidate] (1.231 ms) : 0, 1231
BytebuddyAgent [baseline] (804.054 ms) : 0, 804054
BytebuddyAgent [candidate] (800.6 ms) : 0, 800600
AgentMeter [baseline] (11.352 ms) : 0, 11352
AgentMeter [candidate] (11.419 ms) : 0, 11419
GlobalTracer [baseline] (239.449 ms) : 0, 239449
GlobalTracer [candidate] (239.451 ms) : 0, 239451
AppSec [baseline] (31.217 ms) : 0, 31217
AppSec [candidate] (32.392 ms) : 0, 32392
Debugger [baseline] (62.237 ms) : 0, 62237
Debugger [candidate] (62.181 ms) : 0, 62181
Remote Config [baseline] (548.03 µs) : 0, 548
Remote Config [candidate] (2.33 ms) : 0, 2330
Telemetry [baseline] (11.132 ms) : 0, 11132
Telemetry [candidate] (9.478 ms) : 0, 9478
Flare Poller [baseline] (3.463 ms) : 0, 3463
Flare Poller [candidate] (3.483 ms) : 0, 3483
IAST [baseline] (25.738 ms) : 0, 25738
IAST [candidate] (25.875 ms) : 0, 25875
Startup time reports for petclinicgantt
title petclinic - global startup overhead: candidate=1.61.0-SNAPSHOT~9a502fa3cf, baseline=1.62.0-SNAPSHOT~071ce9dae5
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.069 s) : 0, 1069263
Total [baseline] (11.151 s) : 0, 11150708
Agent [candidate] (1.059 s) : 0, 1058570
Total [candidate] (11.072 s) : 0, 11072498
section appsec
Agent [baseline] (1.266 s) : 0, 1266430
Total [baseline] (11.144 s) : 0, 11144127
Agent [candidate] (1.261 s) : 0, 1260941
Total [candidate] (11.129 s) : 0, 11128807
section iast
Agent [baseline] (1.228 s) : 0, 1227564
Total [baseline] (11.324 s) : 0, 11324218
Agent [candidate] (1.224 s) : 0, 1224276
Total [candidate] (11.306 s) : 0, 11306321
section profiling
Agent [baseline] (1.188 s) : 0, 1188111
Total [baseline] (11.091 s) : 0, 11091186
Agent [candidate] (1.193 s) : 0, 1192910
Total [candidate] (11.183 s) : 0, 11182855
gantt
title petclinic - break down per module: candidate=1.61.0-SNAPSHOT~9a502fa3cf, baseline=1.62.0-SNAPSHOT~071ce9dae5
dateFormat X
axisFormat %s
section tracing
crashtracking [baseline] (1.274 ms) : 0, 1274
crashtracking [candidate] (1.229 ms) : 0, 1229
BytebuddyAgent [baseline] (640.111 ms) : 0, 640111
BytebuddyAgent [candidate] (632.925 ms) : 0, 632925
AgentMeter [baseline] (29.728 ms) : 0, 29728
AgentMeter [candidate] (29.197 ms) : 0, 29197
GlobalTracer [baseline] (250.859 ms) : 0, 250859
GlobalTracer [candidate] (248.77 ms) : 0, 248770
AppSec [baseline] (32.649 ms) : 0, 32649
AppSec [candidate] (32.161 ms) : 0, 32161
Debugger [baseline] (60.281 ms) : 0, 60281
Debugger [candidate] (59.804 ms) : 0, 59804
Remote Config [baseline] (605.418 µs) : 0, 605
Remote Config [candidate] (603.331 µs) : 0, 603
Telemetry [baseline] (8.17 ms) : 0, 8170
Telemetry [candidate] (8.313 ms) : 0, 8313
Flare Poller [baseline] (8.977 ms) : 0, 8977
Flare Poller [candidate] (9.243 ms) : 0, 9243
section appsec
crashtracking [baseline] (1.246 ms) : 0, 1246
crashtracking [candidate] (1.231 ms) : 0, 1231
BytebuddyAgent [baseline] (671.753 ms) : 0, 671753
BytebuddyAgent [candidate] (668.405 ms) : 0, 668405
AgentMeter [baseline] (12.245 ms) : 0, 12245
AgentMeter [candidate] (12.204 ms) : 0, 12204
GlobalTracer [baseline] (252.694 ms) : 0, 252694
GlobalTracer [candidate] (251.678 ms) : 0, 251678
IAST [baseline] (24.891 ms) : 0, 24891
IAST [candidate] (24.926 ms) : 0, 24926
AppSec [baseline] (187.597 ms) : 0, 187597
AppSec [candidate] (186.713 ms) : 0, 186713
Debugger [baseline] (66.56 ms) : 0, 66560
Debugger [candidate] (66.593 ms) : 0, 66593
Remote Config [baseline] (628.875 µs) : 0, 629
Remote Config [candidate] (603.099 µs) : 0, 603
Telemetry [baseline] (8.475 ms) : 0, 8475
Telemetry [candidate] (8.451 ms) : 0, 8451
Flare Poller [baseline] (3.569 ms) : 0, 3569
Flare Poller [candidate] (3.599 ms) : 0, 3599
section iast
crashtracking [baseline] (1.234 ms) : 0, 1234
crashtracking [candidate] (1.217 ms) : 0, 1217
BytebuddyAgent [baseline] (803.44 ms) : 0, 803440
BytebuddyAgent [candidate] (800.583 ms) : 0, 800583
AgentMeter [baseline] (11.44 ms) : 0, 11440
AgentMeter [candidate] (11.401 ms) : 0, 11401
GlobalTracer [baseline] (240.107 ms) : 0, 240107
GlobalTracer [candidate] (239.593 ms) : 0, 239593
IAST [baseline] (25.89 ms) : 0, 25890
IAST [candidate] (25.68 ms) : 0, 25680
AppSec [baseline] (31.978 ms) : 0, 31978
AppSec [candidate] (33.604 ms) : 0, 33604
Debugger [baseline] (62.722 ms) : 0, 62722
Debugger [candidate] (61.313 ms) : 0, 61313
Remote Config [baseline] (549.812 µs) : 0, 550
Remote Config [candidate] (1.114 ms) : 0, 1114
Telemetry [baseline] (10.545 ms) : 0, 10545
Telemetry [candidate] (9.895 ms) : 0, 9895
Flare Poller [baseline] (3.424 ms) : 0, 3424
Flare Poller [candidate] (3.529 ms) : 0, 3529
section profiling
crashtracking [baseline] (1.196 ms) : 0, 1196
crashtracking [candidate] (1.192 ms) : 0, 1192
BytebuddyAgent [baseline] (693.433 ms) : 0, 693433
BytebuddyAgent [candidate] (697.206 ms) : 0, 697206
AgentMeter [baseline] (9.178 ms) : 0, 9178
AgentMeter [candidate] (9.201 ms) : 0, 9201
GlobalTracer [baseline] (207.82 ms) : 0, 207820
GlobalTracer [candidate] (208.681 ms) : 0, 208681
AppSec [baseline] (32.887 ms) : 0, 32887
AppSec [candidate] (32.855 ms) : 0, 32855
Debugger [baseline] (66.24 ms) : 0, 66240
Debugger [candidate] (65.748 ms) : 0, 65748
Remote Config [baseline] (591.414 µs) : 0, 591
Remote Config [candidate] (570.678 µs) : 0, 571
Telemetry [baseline] (7.847 ms) : 0, 7847
Telemetry [candidate] (7.898 ms) : 0, 7898
Flare Poller [baseline] (3.591 ms) : 0, 3591
Flare Poller [candidate] (3.544 ms) : 0, 3544
ProfilingAgent [baseline] (93.849 ms) : 0, 93849
ProfilingAgent [candidate] (94.123 ms) : 0, 94123
Profiling [baseline] (94.412 ms) : 0, 94412
Profiling [candidate] (94.704 ms) : 0, 94704
LoadParameters
See matching parameters
SummaryFound 5 performance improvements and 1 performance regressions! Performance is the same for 14 metrics, 16 unstable metrics.
Request duration reports for insecure-bankgantt
title insecure-bank - request duration [CI 0.99] : candidate=1.61.0-SNAPSHOT~9a502fa3cf, baseline=1.62.0-SNAPSHOT~071ce9dae5
dateFormat X
axisFormat %s
section baseline
no_agent (1.251 ms) : 1239, 1263
. : milestone, 1251,
iast (3.261 ms) : 3217, 3305
. : milestone, 3261,
iast_FULL (5.974 ms) : 5914, 6035
. : milestone, 5974,
iast_GLOBAL (3.815 ms) : 3761, 3869
. : milestone, 3815,
profiling (2.174 ms) : 2154, 2193
. : milestone, 2174,
tracing (1.988 ms) : 1971, 2005
. : milestone, 1988,
section candidate
no_agent (1.239 ms) : 1227, 1251
. : milestone, 1239,
iast (3.253 ms) : 3208, 3297
. : milestone, 3253,
iast_FULL (6.063 ms) : 6001, 6124
. : milestone, 6063,
iast_GLOBAL (3.725 ms) : 3664, 3786
. : milestone, 3725,
profiling (2.303 ms) : 2280, 2326
. : milestone, 2303,
tracing (1.875 ms) : 1860, 1891
. : milestone, 1875,
Request duration reports for petclinicgantt
title petclinic - request duration [CI 0.99] : candidate=1.61.0-SNAPSHOT~9a502fa3cf, baseline=1.62.0-SNAPSHOT~071ce9dae5
dateFormat X
axisFormat %s
section baseline
no_agent (18.379 ms) : 18190, 18568
. : milestone, 18379,
appsec (18.741 ms) : 18555, 18927
. : milestone, 18741,
code_origins (18.106 ms) : 17929, 18282
. : milestone, 18106,
iast (18.969 ms) : 18776, 19163
. : milestone, 18969,
profiling (19.587 ms) : 19387, 19786
. : milestone, 19587,
tracing (19.18 ms) : 18985, 19376
. : milestone, 19180,
section candidate
no_agent (19.453 ms) : 19255, 19651
. : milestone, 19453,
appsec (18.898 ms) : 18707, 19090
. : milestone, 18898,
code_origins (18.119 ms) : 17937, 18300
. : milestone, 18119,
iast (18.081 ms) : 17904, 18259
. : milestone, 18081,
profiling (18.467 ms) : 18284, 18649
. : milestone, 18467,
tracing (17.83 ms) : 17654, 18006
. : milestone, 17830,
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 tomcatgantt
title tomcat - execution time [CI 0.99] : candidate=1.61.0-SNAPSHOT~9a502fa3cf, baseline=1.62.0-SNAPSHOT~071ce9dae5
dateFormat X
axisFormat %s
section baseline
no_agent (1.497 ms) : 1485, 1509
. : milestone, 1497,
appsec (2.557 ms) : 2501, 2612
. : milestone, 2557,
iast (2.279 ms) : 2210, 2348
. : milestone, 2279,
iast_GLOBAL (2.33 ms) : 2260, 2400
. : milestone, 2330,
profiling (2.522 ms) : 2310, 2733
. : milestone, 2522,
tracing (2.086 ms) : 2033, 2140
. : milestone, 2086,
section candidate
no_agent (1.495 ms) : 1483, 1506
. : milestone, 1495,
appsec (2.534 ms) : 2479, 2588
. : milestone, 2534,
iast (2.28 ms) : 2211, 2350
. : milestone, 2280,
iast_GLOBAL (2.324 ms) : 2255, 2394
. : milestone, 2324,
profiling (2.116 ms) : 2061, 2172
. : milestone, 2116,
tracing (2.097 ms) : 2044, 2151
. : milestone, 2097,
Execution time for biojavagantt
title biojava - execution time [CI 0.99] : candidate=1.61.0-SNAPSHOT~9a502fa3cf, baseline=1.62.0-SNAPSHOT~071ce9dae5
dateFormat X
axisFormat %s
section baseline
no_agent (15.015 s) : 15015000, 15015000
. : milestone, 15015000,
appsec (14.516 s) : 14516000, 14516000
. : milestone, 14516000,
iast (18.627 s) : 18627000, 18627000
. : milestone, 18627000,
iast_GLOBAL (17.989 s) : 17989000, 17989000
. : milestone, 17989000,
profiling (15.448 s) : 15448000, 15448000
. : milestone, 15448000,
tracing (14.795 s) : 14795000, 14795000
. : milestone, 14795000,
section candidate
no_agent (15.082 s) : 15082000, 15082000
. : milestone, 15082000,
appsec (14.882 s) : 14882000, 14882000
. : milestone, 14882000,
iast (18.433 s) : 18433000, 18433000
. : milestone, 18433000,
iast_GLOBAL (18.187 s) : 18187000, 18187000
. : milestone, 18187000,
profiling (14.974 s) : 14974000, 14974000
. : milestone, 14974000,
tracing (14.937 s) : 14937000, 14937000
. : milestone, 14937000,
|
# Conflicts: # dd-trace-core/src/main/java/datadog/trace/core/DDSpan.java # dd-trace-core/src/main/java/datadog/trace/core/DDSpanContext.java
|
Hi! 👋 Thanks for your pull request! 🎉 To help us review it, please make sure to:
If you need help, please check our contributing guidelines. |
|
The following files add Groovy tests to modules that are candidates for migration to Java / JUnit 5:
Consider writing these tests in Java / JUnit 5 instead to help with the ongoing migration effort. |
|
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. |
| if (DDTags.SPAN_EVENTS.equals(entry.tag())) { | ||
| continue; | ||
| } | ||
| writeFlattenedTagAttribute(writable, entry.tag(), entry.objectValue()); |
There was a problem hiding this comment.
I'd like to try to avoid boxing primitives here.
I think making a variant of writeFlattenedTagAttribute that takes writable, entryReader might make sense.
Then we check if the TagMap.EntryReader is holding a primitive before calling objectValue.
There was a problem hiding this comment.
Refactored.
| static final int SPAN_KIND_CONSUMER = 5; | ||
|
|
||
| // Decision maker tag key | ||
| private static final String KEY_DECISION_MAKER = "_dd.p.dm"; |
There was a problem hiding this comment.
We probably want to use Utf8BytesString for these. It caches the UTF8 representation, so we don't keep paying the encoding cost.
Admittedly, I didn't double check where KEY_DECISION_MAKER is used, so I'll let you make the final decision on that.
There was a problem hiding this comment.
I double checked the code and I can see that KEY_DECISION_MAKER used for lookup only, so not sure how UTF8 can be applied here. I think the we can do one more round of optimizations for UTF8 cached values in follow up PRs, but probably v1 should be good as-is as it is maintaining string table with all unique strings already, that can be considered as a cache already.
| writable.writeInt(fieldId); | ||
| writable.startArray(spansCount); | ||
|
|
||
| for (int i = 0; i < spansCount; i++) { |
There was a problem hiding this comment.
Is the c-style for loop, so we can access the index?
As an alternative, we could use a ListIterator.
I've typically found Iterators to be better than c-style for loops, but I'll admit it can be situational. We probably just need to benchmark with v1 and see.
I can share my stress test if you like.
| String linksTag = DDSpanLink.toTag(restrictedSpan.getLinks()); | ||
| if (linksTag != null) { | ||
| unsafeTags.put(SPAN_LINKS, linksTag); | ||
| if (spanLinksAsTag) { |
There was a problem hiding this comment.
It would be nice if we could find a nicer way to encapsulate the handling of span links.
Although for now, I think this is fine.
There was a problem hiding this comment.
I wondering if the MetadataConsumer could indicate how it wants to receive the span links. Although, admittedly, I don't remember quite where the MetadataConsumer originates from.
| longRunningVersion, | ||
| ProcessTags.getTagsForSerialization())); | ||
| ProcessTags.getTagsForSerialization(), | ||
| restrictedSpan.getLinks())); |
There was a problem hiding this comment.
I see, so we have to pass span links through metadata now. That makes sense.
Since Metadata is more of the payload version of span, maybe we should push the handling of links down into it.
| int statusCode, | ||
| CharSequence origin) { | ||
| CharSequence origin, | ||
| List<AgentSpanLink> spanLinks = emptyList()) { |
There was a problem hiding this comment.
The test code feels a little messy to me with both having an optional empty list and turning null into empty list below, but I understand updating these tests is tedious.
|
|
||
| void processTagsAndBaggage(MetadataConsumer consumer); | ||
|
|
||
| /** |
There was a problem hiding this comment.
processTagsAndBaggage is a bit of internals that I'd prefer not to expose.
Nevermind, I guess we already exposed processTagsAndBaggage.
However, I'm a bit confused as to why we still need the old processTagsAndBaggage that just takes the MetadataConsumer.
What Does This Do
Java implementation for protocol v1.
Motivation
Additional Notes
DO NOT MERGE, WIP.