-
Notifications
You must be signed in to change notification settings - Fork 319
Add primitive setters to DDSpanContext to take advantage of TagMap #10018
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Previous static extraction caused a test to fail because links logic relied on having a side effect on the builder instance's List<AgentSpanLink>
Adding primitive setters to DDSpanContext to take advantage of TagMap primitive storage Using precheck of tagInterceptor.needsIntercept to avoid boxing while calling tagInterceptor.interceptTag
This comment has been minimized.
This comment has been minimized.
BenchmarksStartupParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 61 metrics, 4 unstable metrics. Startup time reports for insecure-bankgantt
title insecure-bank - global startup overhead: candidate=1.56.0-SNAPSHOT~e9bfa9f204, baseline=1.57.0-SNAPSHOT~6836076eba
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.079 s) : 0, 1078531
Total [baseline] (8.752 s) : 0, 8752057
Agent [candidate] (1.093 s) : 0, 1092572
Total [candidate] (8.801 s) : 0, 8801071
section iast
Agent [baseline] (1.222 s) : 0, 1222181
Total [baseline] (9.5 s) : 0, 9499866
Agent [candidate] (1.221 s) : 0, 1221417
Total [candidate] (9.47 s) : 0, 9469977
gantt
title insecure-bank - break down per module: candidate=1.56.0-SNAPSHOT~e9bfa9f204, baseline=1.57.0-SNAPSHOT~6836076eba
dateFormat X
axisFormat %s
section tracing
crashtracking [baseline] (1.187 ms) : 0, 1187
crashtracking [candidate] (1.189 ms) : 0, 1189
BytebuddyAgent [baseline] (647.562 ms) : 0, 647562
BytebuddyAgent [candidate] (656.37 ms) : 0, 656370
GlobalTracer [baseline] (281.074 ms) : 0, 281074
GlobalTracer [candidate] (285.475 ms) : 0, 285475
AppSec [baseline] (32.341 ms) : 0, 32341
AppSec [candidate] (32.751 ms) : 0, 32751
Debugger [baseline] (67.457 ms) : 0, 67457
Debugger [candidate] (67.658 ms) : 0, 67658
Remote Config [baseline] (633.972 µs) : 0, 634
Remote Config [candidate] (653.389 µs) : 0, 653
Telemetry [baseline] (9.044 ms) : 0, 9044
Telemetry [candidate] (9.013 ms) : 0, 9013
Flare Poller [baseline] (3.644 ms) : 0, 3644
Flare Poller [candidate] (3.72 ms) : 0, 3720
section iast
crashtracking [baseline] (1.196 ms) : 0, 1196
crashtracking [candidate] (1.187 ms) : 0, 1187
BytebuddyAgent [baseline] (790.804 ms) : 0, 790804
BytebuddyAgent [candidate] (789.814 ms) : 0, 789814
GlobalTracer [baseline] (255.714 ms) : 0, 255714
GlobalTracer [candidate] (255.757 ms) : 0, 255757
AppSec [baseline] (34.515 ms) : 0, 34515
AppSec [candidate] (35.302 ms) : 0, 35302
Debugger [baseline] (65.211 ms) : 0, 65211
Debugger [candidate] (64.59 ms) : 0, 64590
Remote Config [baseline] (532.356 µs) : 0, 532
Remote Config [candidate] (530.975 µs) : 0, 531
Telemetry [baseline] (8.361 ms) : 0, 8361
Telemetry [candidate] (8.416 ms) : 0, 8416
Flare Poller [baseline] (3.434 ms) : 0, 3434
Flare Poller [candidate] (3.45 ms) : 0, 3450
IAST [baseline] (26.904 ms) : 0, 26904
IAST [candidate] (26.97 ms) : 0, 26970
Startup time reports for petclinicgantt
title petclinic - global startup overhead: candidate=1.56.0-SNAPSHOT~e9bfa9f204, baseline=1.57.0-SNAPSHOT~6836076eba
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.079 s) : 0, 1079403
Total [baseline] (10.895 s) : 0, 10894919
Agent [candidate] (1.09 s) : 0, 1090357
Total [candidate] (10.891 s) : 0, 10891194
section appsec
Agent [baseline] (1.263 s) : 0, 1262795
Total [baseline] (11.112 s) : 0, 11111552
Agent [candidate] (1.271 s) : 0, 1271482
Total [candidate] (11.093 s) : 0, 11093427
section iast
Agent [baseline] (1.224 s) : 0, 1223699
Total [baseline] (11.205 s) : 0, 11204604
Agent [candidate] (1.224 s) : 0, 1224154
Total [candidate] (11.203 s) : 0, 11202700
section profiling
Agent [baseline] (1.222 s) : 0, 1222123
Total [baseline] (11.141 s) : 0, 11141054
Agent [candidate] (1.209 s) : 0, 1208972
Total [candidate] (11.052 s) : 0, 11051575
gantt
title petclinic - break down per module: candidate=1.56.0-SNAPSHOT~e9bfa9f204, baseline=1.57.0-SNAPSHOT~6836076eba
dateFormat X
axisFormat %s
section tracing
crashtracking [baseline] (1.199 ms) : 0, 1199
crashtracking [candidate] (1.207 ms) : 0, 1207
BytebuddyAgent [baseline] (647.817 ms) : 0, 647817
BytebuddyAgent [candidate] (654.47 ms) : 0, 654470
GlobalTracer [baseline] (281.044 ms) : 0, 281044
GlobalTracer [candidate] (284.028 ms) : 0, 284028
AppSec [baseline] (32.398 ms) : 0, 32398
AppSec [candidate] (32.648 ms) : 0, 32648
Debugger [baseline] (68.027 ms) : 0, 68027
Debugger [candidate] (68.807 ms) : 0, 68807
Remote Config [baseline] (658.103 µs) : 0, 658
Remote Config [candidate] (645.327 µs) : 0, 645
Telemetry [baseline] (9.007 ms) : 0, 9007
Telemetry [candidate] (9.126 ms) : 0, 9126
Flare Poller [baseline] (3.711 ms) : 0, 3711
Flare Poller [candidate] (3.781 ms) : 0, 3781
section appsec
crashtracking [baseline] (1.189 ms) : 0, 1189
crashtracking [candidate] (1.208 ms) : 0, 1208
BytebuddyAgent [baseline] (687.801 ms) : 0, 687801
BytebuddyAgent [candidate] (694.085 ms) : 0, 694085
GlobalTracer [baseline] (258.885 ms) : 0, 258885
GlobalTracer [candidate] (260.342 ms) : 0, 260342
AppSec [baseline] (174.705 ms) : 0, 174705
AppSec [candidate] (174.417 ms) : 0, 174417
Debugger [baseline] (66.318 ms) : 0, 66318
Debugger [candidate] (67.357 ms) : 0, 67357
Remote Config [baseline] (728.679 µs) : 0, 729
Remote Config [candidate] (725.17 µs) : 0, 725
Telemetry [baseline] (9.06 ms) : 0, 9060
Telemetry [candidate] (8.968 ms) : 0, 8968
Flare Poller [baseline] (3.856 ms) : 0, 3856
Flare Poller [candidate] (3.92 ms) : 0, 3920
IAST [baseline] (24.683 ms) : 0, 24683
IAST [candidate] (24.788 ms) : 0, 24788
section iast
crashtracking [baseline] (1.206 ms) : 0, 1206
crashtracking [candidate] (1.216 ms) : 0, 1216
BytebuddyAgent [baseline] (790.858 ms) : 0, 790858
BytebuddyAgent [candidate] (790.496 ms) : 0, 790496
GlobalTracer [baseline] (255.996 ms) : 0, 255996
GlobalTracer [candidate] (255.575 ms) : 0, 255575
AppSec [baseline] (35.222 ms) : 0, 35222
AppSec [candidate] (35.547 ms) : 0, 35547
Debugger [baseline] (65.726 ms) : 0, 65726
Debugger [candidate] (66.299 ms) : 0, 66299
Remote Config [baseline] (544.977 µs) : 0, 545
Remote Config [candidate] (535.21 µs) : 0, 535
Telemetry [baseline] (8.373 ms) : 0, 8373
Telemetry [candidate] (8.481 ms) : 0, 8481
Flare Poller [baseline] (3.467 ms) : 0, 3467
Flare Poller [candidate] (3.515 ms) : 0, 3515
IAST [baseline] (26.866 ms) : 0, 26866
IAST [candidate] (27.093 ms) : 0, 27093
section profiling
ProfilingAgent [baseline] (98.808 ms) : 0, 98808
ProfilingAgent [candidate] (97.887 ms) : 0, 97887
crashtracking [baseline] (1.216 ms) : 0, 1216
crashtracking [candidate] (1.204 ms) : 0, 1204
BytebuddyAgent [baseline] (714.339 ms) : 0, 714339
BytebuddyAgent [candidate] (704.597 ms) : 0, 704597
GlobalTracer [baseline] (221.814 ms) : 0, 221814
GlobalTracer [candidate] (221.554 ms) : 0, 221554
AppSec [baseline] (32.402 ms) : 0, 32402
AppSec [candidate] (32.499 ms) : 0, 32499
Debugger [baseline] (69.459 ms) : 0, 69459
Debugger [candidate] (67.942 ms) : 0, 67942
Remote Config [baseline] (645.451 µs) : 0, 645
Remote Config [candidate] (610.578 µs) : 0, 611
Telemetry [baseline] (9.049 ms) : 0, 9049
Telemetry [candidate] (8.989 ms) : 0, 8989
Flare Poller [baseline] (3.781 ms) : 0, 3781
Flare Poller [candidate] (3.807 ms) : 0, 3807
Profiling [baseline] (99.408 ms) : 0, 99408
Profiling [candidate] (98.466 ms) : 0, 98466
LoadParameters
See matching parameters
SummaryFound 3 performance improvements and 0 performance regressions! Performance is the same for 16 metrics, 17 unstable metrics.
Request duration reports for petclinicgantt
title petclinic - request duration [CI 0.99] : candidate=1.56.0-SNAPSHOT~e9bfa9f204, baseline=1.57.0-SNAPSHOT~6836076eba
dateFormat X
axisFormat %s
section baseline
no_agent (18.096 ms) : 17915, 18277
. : milestone, 18096,
appsec (18.582 ms) : 18392, 18772
. : milestone, 18582,
code_origins (17.811 ms) : 17632, 17991
. : milestone, 17811,
iast (17.571 ms) : 17394, 17747
. : milestone, 17571,
profiling (18.78 ms) : 18594, 18967
. : milestone, 18780,
tracing (17.965 ms) : 17787, 18143
. : milestone, 17965,
section candidate
no_agent (18.129 ms) : 17939, 18319
. : milestone, 18129,
appsec (18.697 ms) : 18511, 18883
. : milestone, 18697,
code_origins (17.765 ms) : 17588, 17941
. : milestone, 17765,
iast (17.741 ms) : 17564, 17917
. : milestone, 17741,
profiling (18.456 ms) : 18272, 18640
. : milestone, 18456,
tracing (17.679 ms) : 17506, 17853
. : milestone, 17679,
Request duration reports for insecure-bankgantt
title insecure-bank - request duration [CI 0.99] : candidate=1.56.0-SNAPSHOT~e9bfa9f204, baseline=1.57.0-SNAPSHOT~6836076eba
dateFormat X
axisFormat %s
section baseline
no_agent (1.278 ms) : 1265, 1291
. : milestone, 1278,
iast (3.376 ms) : 3336, 3416
. : milestone, 3376,
iast_FULL (6.086 ms) : 6024, 6148
. : milestone, 6086,
iast_GLOBAL (3.598 ms) : 3544, 3651
. : milestone, 3598,
profiling (2.107 ms) : 2089, 2126
. : milestone, 2107,
tracing (1.814 ms) : 1799, 1829
. : milestone, 1814,
section candidate
no_agent (1.204 ms) : 1191, 1216
. : milestone, 1204,
iast (3.296 ms) : 3246, 3345
. : milestone, 3296,
iast_FULL (5.715 ms) : 5658, 5772
. : milestone, 5715,
iast_GLOBAL (3.558 ms) : 3509, 3607
. : milestone, 3558,
profiling (1.932 ms) : 1916, 1948
. : milestone, 1932,
tracing (1.797 ms) : 1782, 1812
. : milestone, 1797,
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.56.0-SNAPSHOT~e9bfa9f204, baseline=1.57.0-SNAPSHOT~6836076eba
dateFormat X
axisFormat %s
section baseline
no_agent (1.478 ms) : 1466, 1489
. : milestone, 1478,
appsec (3.673 ms) : 3457, 3889
. : milestone, 3673,
iast (2.206 ms) : 2141, 2270
. : milestone, 2206,
iast_GLOBAL (2.257 ms) : 2192, 2321
. : milestone, 2257,
profiling (2.092 ms) : 2038, 2147
. : milestone, 2092,
tracing (2.049 ms) : 1997, 2100
. : milestone, 2049,
section candidate
no_agent (1.473 ms) : 1462, 1484
. : milestone, 1473,
appsec (3.616 ms) : 3403, 3829
. : milestone, 3616,
iast (2.21 ms) : 2145, 2275
. : milestone, 2210,
iast_GLOBAL (2.253 ms) : 2188, 2318
. : milestone, 2253,
profiling (2.063 ms) : 2010, 2116
. : milestone, 2063,
tracing (2.044 ms) : 1993, 2095
. : milestone, 2044,
Execution time for biojavagantt
title biojava - execution time [CI 0.99] : candidate=1.56.0-SNAPSHOT~e9bfa9f204, baseline=1.57.0-SNAPSHOT~6836076eba
dateFormat X
axisFormat %s
section baseline
no_agent (15.544 s) : 15544000, 15544000
. : milestone, 15544000,
appsec (14.479 s) : 14479000, 14479000
. : milestone, 14479000,
iast (18.151 s) : 18151000, 18151000
. : milestone, 18151000,
iast_GLOBAL (17.882 s) : 17882000, 17882000
. : milestone, 17882000,
profiling (14.749 s) : 14749000, 14749000
. : milestone, 14749000,
tracing (14.573 s) : 14573000, 14573000
. : milestone, 14573000,
section candidate
no_agent (15.304 s) : 15304000, 15304000
. : milestone, 15304000,
appsec (14.607 s) : 14607000, 14607000
. : milestone, 14607000,
iast (18.034 s) : 18034000, 18034000
. : milestone, 18034000,
iast_GLOBAL (17.898 s) : 17898000, 17898000
. : milestone, 17898000,
profiling (15.171 s) : 15171000, 15171000
. : milestone, 15171000,
tracing (14.659 s) : 14659000, 14659000
. : milestone, 14659000,
|
To simplify the code, I pulled CoreTracer.getTagInterceptor() into a member variable of DDSpanContext Unfortunately, that caused Mock call checks to fail, so needed to update the PendingTraceBufferTest
ygree
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
What Does This Do
Adds primitive setters to DDSpanContext
Motivation
TagMap can store primitive in its entries directly without boxing
But to take advantage of TagMap, we need to avoid auto-boxing in instrumentation
DDSpan already had primitive setters, but those call into DDSpanContext which didn't have primitive setters
Additional Notes
This code has been structured to behave optimally for both LegacyTagMap (e.g. HashMap) which boxes and OptimizedTagMap which avoids boxing
Right now, the tracer will still end up boxing in the serialization code, but this change at least moves the boxing out of the instrumentation / application critical path. Boxing during serialization will be addressed in a separate pull request.
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]