-
Notifications
You must be signed in to change notification settings - Fork 318
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
Open
dougqh
wants to merge
13
commits into
master
Choose a base branch
from
dougqh/span-primitive-setters
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+374
−92
Conversation
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
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 58 metrics, 7 unstable metrics. Startup time reports for insecure-bankgantt
title insecure-bank - global startup overhead: candidate=1.56.0-SNAPSHOT~411a61896f, baseline=1.56.0-SNAPSHOT~b6d4e4fc4a
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.096 s) : 0, 1096443
Total [baseline] (8.866 s) : 0, 8865960
Agent [candidate] (1.106 s) : 0, 1105744
Total [candidate] (8.842 s) : 0, 8842043
section iast
Agent [baseline] (1.236 s) : 0, 1236373
Total [baseline] (9.536 s) : 0, 9535770
Agent [candidate] (1.248 s) : 0, 1247835
Total [candidate] (9.586 s) : 0, 9585503
gantt
title insecure-bank - break down per module: candidate=1.56.0-SNAPSHOT~411a61896f, baseline=1.56.0-SNAPSHOT~b6d4e4fc4a
dateFormat X
axisFormat %s
section tracing
crashtracking [baseline] (1.446 ms) : 0, 1446
crashtracking [candidate] (1.456 ms) : 0, 1456
BytebuddyAgent [baseline] (704.767 ms) : 0, 704767
BytebuddyAgent [candidate] (710.754 ms) : 0, 710754
GlobalTracer [baseline] (247.699 ms) : 0, 247699
GlobalTracer [candidate] (249.724 ms) : 0, 249724
AppSec [baseline] (32.019 ms) : 0, 32019
AppSec [candidate] (32.476 ms) : 0, 32476
Debugger [baseline] (63.308 ms) : 0, 63308
Debugger [candidate] (63.705 ms) : 0, 63705
Remote Config [baseline] (637.154 µs) : 0, 637
Remote Config [candidate] (633.428 µs) : 0, 633
Telemetry [baseline] (8.18 ms) : 0, 8180
Telemetry [candidate] (8.352 ms) : 0, 8352
Flare Poller [baseline] (3.665 ms) : 0, 3665
Flare Poller [candidate] (3.792 ms) : 0, 3792
section iast
crashtracking [baseline] (1.459 ms) : 0, 1459
crashtracking [candidate] (1.463 ms) : 0, 1463
BytebuddyAgent [baseline] (829.804 ms) : 0, 829804
BytebuddyAgent [candidate] (837.34 ms) : 0, 837340
GlobalTracer [baseline] (237.51 ms) : 0, 237510
GlobalTracer [candidate] (239.799 ms) : 0, 239799
IAST [baseline] (27.546 ms) : 0, 27546
IAST [candidate] (27.812 ms) : 0, 27812
AppSec [baseline] (33.595 ms) : 0, 33595
AppSec [candidate] (34.159 ms) : 0, 34159
Debugger [baseline] (59.969 ms) : 0, 59969
Debugger [candidate] (60.473 ms) : 0, 60473
Remote Config [baseline] (545.784 µs) : 0, 546
Remote Config [candidate] (552.23 µs) : 0, 552
Telemetry [baseline] (7.636 ms) : 0, 7636
Telemetry [candidate] (7.712 ms) : 0, 7712
Flare Poller [baseline] (3.45 ms) : 0, 3450
Flare Poller [candidate] (3.485 ms) : 0, 3485
Startup time reports for petclinicgantt
title petclinic - global startup overhead: candidate=1.56.0-SNAPSHOT~411a61896f, baseline=1.56.0-SNAPSHOT~b6d4e4fc4a
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.107 s) : 0, 1107031
Total [baseline] (10.853 s) : 0, 10852678
Agent [candidate] (1.101 s) : 0, 1100812
Total [candidate] (10.801 s) : 0, 10801015
section appsec
Agent [baseline] (1.287 s) : 0, 1286621
Total [baseline] (11.181 s) : 0, 11180648
Agent [candidate] (1.284 s) : 0, 1283914
Total [candidate] (11.207 s) : 0, 11207021
section iast
Agent [baseline] (1.239 s) : 0, 1238769
Total [baseline] (11.3 s) : 0, 11299960
Agent [candidate] (1.244 s) : 0, 1243652
Total [candidate] (11.221 s) : 0, 11220523
section profiling
Agent [baseline] (1.229 s) : 0, 1229160
Total [baseline] (11.139 s) : 0, 11139229
Agent [candidate] (1.236 s) : 0, 1236140
Total [candidate] (11.137 s) : 0, 11137171
gantt
title petclinic - break down per module: candidate=1.56.0-SNAPSHOT~411a61896f, baseline=1.56.0-SNAPSHOT~b6d4e4fc4a
dateFormat X
axisFormat %s
section tracing
crashtracking [baseline] (1.465 ms) : 0, 1465
crashtracking [candidate] (1.461 ms) : 0, 1461
BytebuddyAgent [baseline] (711.298 ms) : 0, 711298
BytebuddyAgent [candidate] (706.579 ms) : 0, 706579
GlobalTracer [baseline] (249.986 ms) : 0, 249986
GlobalTracer [candidate] (248.875 ms) : 0, 248875
AppSec [baseline] (32.5 ms) : 0, 32500
AppSec [candidate] (32.267 ms) : 0, 32267
Debugger [baseline] (64.205 ms) : 0, 64205
Debugger [candidate] (64.152 ms) : 0, 64152
Remote Config [baseline] (640.311 µs) : 0, 640
Remote Config [candidate] (636.195 µs) : 0, 636
Telemetry [baseline] (8.266 ms) : 0, 8266
Telemetry [candidate] (8.281 ms) : 0, 8281
Flare Poller [baseline] (3.69 ms) : 0, 3690
Flare Poller [candidate] (3.686 ms) : 0, 3686
section appsec
crashtracking [baseline] (1.465 ms) : 0, 1465
crashtracking [candidate] (1.449 ms) : 0, 1449
BytebuddyAgent [baseline] (734.167 ms) : 0, 734167
BytebuddyAgent [candidate] (731.83 ms) : 0, 731830
GlobalTracer [baseline] (241.348 ms) : 0, 241348
GlobalTracer [candidate] (241.216 ms) : 0, 241216
IAST [baseline] (25.095 ms) : 0, 25095
IAST [candidate] (25.03 ms) : 0, 25030
AppSec [baseline] (175.106 ms) : 0, 175106
AppSec [candidate] (174.604 ms) : 0, 174604
Debugger [baseline] (61.501 ms) : 0, 61501
Debugger [candidate] (61.598 ms) : 0, 61598
Remote Config [baseline] (690.475 µs) : 0, 690
Remote Config [candidate] (683.502 µs) : 0, 684
Telemetry [baseline] (8.285 ms) : 0, 8285
Telemetry [candidate] (8.464 ms) : 0, 8464
Flare Poller [baseline] (3.93 ms) : 0, 3930
Flare Poller [candidate] (4.089 ms) : 0, 4089
section iast
crashtracking [baseline] (1.45 ms) : 0, 1450
crashtracking [candidate] (1.456 ms) : 0, 1456
BytebuddyAgent [baseline] (829.678 ms) : 0, 829678
BytebuddyAgent [candidate] (834.017 ms) : 0, 834017
GlobalTracer [baseline] (238.456 ms) : 0, 238456
GlobalTracer [candidate] (238.979 ms) : 0, 238979
IAST [baseline] (29.336 ms) : 0, 29336
IAST [candidate] (31.685 ms) : 0, 31685
AppSec [baseline] (32.166 ms) : 0, 32166
AppSec [candidate] (29.653 ms) : 0, 29653
Debugger [baseline] (61.026 ms) : 0, 61026
Debugger [candidate] (61.101 ms) : 0, 61101
Remote Config [baseline] (547.643 µs) : 0, 548
Remote Config [candidate] (546.656 µs) : 0, 547
Telemetry [baseline] (7.693 ms) : 0, 7693
Telemetry [candidate] (7.739 ms) : 0, 7739
Flare Poller [baseline] (3.505 ms) : 0, 3505
Flare Poller [candidate] (3.534 ms) : 0, 3534
section profiling
crashtracking [baseline] (1.432 ms) : 0, 1432
crashtracking [candidate] (1.439 ms) : 0, 1439
BytebuddyAgent [baseline] (731.353 ms) : 0, 731353
BytebuddyAgent [candidate] (735.711 ms) : 0, 735711
GlobalTracer [baseline] (222.548 ms) : 0, 222548
GlobalTracer [candidate] (223.146 ms) : 0, 223146
AppSec [baseline] (32.162 ms) : 0, 32162
AppSec [candidate] (32.421 ms) : 0, 32421
Debugger [baseline] (62.91 ms) : 0, 62910
Debugger [candidate] (62.943 ms) : 0, 62943
Remote Config [baseline] (667.231 µs) : 0, 667
Remote Config [candidate] (655.364 µs) : 0, 655
Telemetry [baseline] (7.939 ms) : 0, 7939
Telemetry [candidate] (8.028 ms) : 0, 8028
Flare Poller [baseline] (3.731 ms) : 0, 3731
Flare Poller [candidate] (3.765 ms) : 0, 3765
ProfilingAgent [baseline] (96.646 ms) : 0, 96646
ProfilingAgent [candidate] (97.983 ms) : 0, 97983
Profiling [baseline] (97.254 ms) : 0, 97254
Profiling [candidate] (98.589 ms) : 0, 98589
LoadParameters
See matching parameters
SummaryFound 0 performance improvements and 2 performance regressions! Performance is the same for 17 metrics, 17 unstable metrics.
Request duration reports for insecure-bankgantt
title insecure-bank - request duration [CI 0.99] : candidate=1.56.0-SNAPSHOT~411a61896f, baseline=1.56.0-SNAPSHOT~b6d4e4fc4a
dateFormat X
axisFormat %s
section baseline
no_agent (1.313 ms) : 1299, 1327
. : milestone, 1313,
iast (3.237 ms) : 3184, 3291
. : milestone, 3237,
iast_FULL (5.679 ms) : 5624, 5735
. : milestone, 5679,
iast_GLOBAL (3.55 ms) : 3499, 3601
. : milestone, 3550,
profiling (1.972 ms) : 1955, 1990
. : milestone, 1972,
tracing (1.833 ms) : 1817, 1849
. : milestone, 1833,
section candidate
no_agent (1.201 ms) : 1190, 1212
. : milestone, 1201,
iast (3.447 ms) : 3372, 3521
. : milestone, 3447,
iast_FULL (5.739 ms) : 5682, 5796
. : milestone, 5739,
iast_GLOBAL (3.779 ms) : 3690, 3868
. : milestone, 3779,
profiling (2.054 ms) : 2036, 2072
. : milestone, 2054,
tracing (1.811 ms) : 1796, 1826
. : milestone, 1811,
Request duration reports for petclinicgantt
title petclinic - request duration [CI 0.99] : candidate=1.56.0-SNAPSHOT~411a61896f, baseline=1.56.0-SNAPSHOT~b6d4e4fc4a
dateFormat X
axisFormat %s
section baseline
no_agent (18.485 ms) : 18297, 18674
. : milestone, 18485,
appsec (18.532 ms) : 18345, 18720
. : milestone, 18532,
code_origins (17.757 ms) : 17581, 17933
. : milestone, 17757,
iast (17.997 ms) : 17816, 18178
. : milestone, 17997,
profiling (19.509 ms) : 19312, 19706
. : milestone, 19509,
tracing (17.513 ms) : 17338, 17687
. : milestone, 17513,
section candidate
no_agent (19.61 ms) : 19404, 19815
. : milestone, 19610,
appsec (18.643 ms) : 18454, 18832
. : milestone, 18643,
code_origins (17.74 ms) : 17561, 17918
. : milestone, 17740,
iast (18.056 ms) : 17874, 18237
. : milestone, 18056,
profiling (19.107 ms) : 18910, 19304
. : milestone, 19107,
tracing (17.646 ms) : 17473, 17819
. : milestone, 17646,
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~411a61896f, baseline=1.56.0-SNAPSHOT~b6d4e4fc4a
dateFormat X
axisFormat %s
section baseline
no_agent (1.482 ms) : 1471, 1493
. : milestone, 1482,
appsec (3.719 ms) : 3499, 3938
. : milestone, 3719,
iast (2.213 ms) : 2149, 2277
. : milestone, 2213,
iast_GLOBAL (2.258 ms) : 2194, 2322
. : milestone, 2258,
profiling (2.062 ms) : 2011, 2113
. : milestone, 2062,
tracing (2.029 ms) : 1979, 2078
. : milestone, 2029,
section candidate
no_agent (1.482 ms) : 1470, 1494
. : milestone, 1482,
appsec (3.695 ms) : 3479, 3911
. : milestone, 3695,
iast (2.218 ms) : 2154, 2281
. : milestone, 2218,
iast_GLOBAL (2.266 ms) : 2202, 2330
. : milestone, 2266,
profiling (2.082 ms) : 2029, 2135
. : milestone, 2082,
tracing (2.04 ms) : 1991, 2090
. : milestone, 2040,
Execution time for biojavagantt
title biojava - execution time [CI 0.99] : candidate=1.56.0-SNAPSHOT~411a61896f, baseline=1.56.0-SNAPSHOT~b6d4e4fc4a
dateFormat X
axisFormat %s
section baseline
no_agent (14.959 s) : 14959000, 14959000
. : milestone, 14959000,
appsec (14.841 s) : 14841000, 14841000
. : milestone, 14841000,
iast (18.849 s) : 18849000, 18849000
. : milestone, 18849000,
iast_GLOBAL (18.02 s) : 18020000, 18020000
. : milestone, 18020000,
profiling (14.804 s) : 14804000, 14804000
. : milestone, 14804000,
tracing (14.842 s) : 14842000, 14842000
. : milestone, 14842000,
section candidate
no_agent (15.04 s) : 15040000, 15040000
. : milestone, 15040000,
appsec (14.811 s) : 14811000, 14811000
. : milestone, 14811000,
iast (18.503 s) : 18503000, 18503000
. : milestone, 18503000,
iast_GLOBAL (18.011 s) : 18011000, 18011000
. : milestone, 18011000,
profiling (14.856 s) : 14856000, 14856000
. : milestone, 14856000,
tracing (14.967 s) : 14967000, 14967000
. : milestone, 14967000,
|
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
comp: core
Tracer core
tag: performance
Performance related changes
type: enhancement
Enhancements and improvements
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
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, DDSpanContext
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 LegagyTagMap (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]