-
Notifications
You must be signed in to change notification settings - Fork 301
Do not inspect reactor context when not needed #8745
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
Conversation
Hi! 👋 Thanks for your pull request! 🎉 To help us review it, please make sure to:
If you need help, please check our contributing guidelines. |
BenchmarksStartupParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 67 metrics, 4 unstable metrics. Startup time reports for insecure-bankgantt
title insecure-bank - global startup overhead: candidate=1.49.0-SNAPSHOT~cdc63bd130, baseline=1.49.0-SNAPSHOT~bd7a9c8502
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.019 s) : 0, 1019051
Total [baseline] (8.671 s) : 0, 8671141
Agent [candidate] (1.004 s) : 0, 1003845
Total [candidate] (8.628 s) : 0, 8628432
section iast
Agent [baseline] (1.135 s) : 0, 1135273
Total [baseline] (9.211 s) : 0, 9210724
Agent [candidate] (1.144 s) : 0, 1144478
Total [candidate] (9.198 s) : 0, 9197630
section iast_HARDCODED_SECRET_DISABLED
Agent [baseline] (1.139 s) : 0, 1139139
Total [baseline] (9.154 s) : 0, 9154348
Agent [candidate] (1.147 s) : 0, 1147050
Total [candidate] (9.168 s) : 0, 9167656
section iast_TELEMETRY_OFF
Agent [baseline] (1.136 s) : 0, 1135628
Total [baseline] (9.201 s) : 0, 9200840
Agent [candidate] (1.134 s) : 0, 1133779
Total [candidate] (9.227 s) : 0, 9226658
gantt
title insecure-bank - break down per module: candidate=1.49.0-SNAPSHOT~cdc63bd130, baseline=1.49.0-SNAPSHOT~bd7a9c8502
dateFormat X
axisFormat %s
section tracing
BytebuddyAgent [baseline] (679.071 ms) : 0, 679071
BytebuddyAgent [candidate] (668.807 ms) : 0, 668807
GlobalTracer [baseline] (242.998 ms) : 0, 242998
GlobalTracer [candidate] (239.64 ms) : 0, 239640
AppSec [baseline] (55.528 ms) : 0, 55528
AppSec [candidate] (54.52 ms) : 0, 54520
Debugger [baseline] (6.225 ms) : 0, 6225
Debugger [candidate] (6.896 ms) : 0, 6896
Remote Config [baseline] (723.081 µs) : 0, 723
Remote Config [candidate] (705.994 µs) : 0, 706
Telemetry [baseline] (10.908 ms) : 0, 10908
Telemetry [candidate] (9.926 ms) : 0, 9926
section iast
BytebuddyAgent [baseline] (788.509 ms) : 0, 788509
BytebuddyAgent [candidate] (795.993 ms) : 0, 795993
GlobalTracer [baseline] (229.895 ms) : 0, 229895
GlobalTracer [candidate] (231.324 ms) : 0, 231324
IAST [baseline] (22.76 ms) : 0, 22760
IAST [candidate] (23.078 ms) : 0, 23078
AppSec [baseline] (56.407 ms) : 0, 56407
AppSec [candidate] (56.191 ms) : 0, 56191
Debugger [baseline] (5.849 ms) : 0, 5849
Debugger [candidate] (5.858 ms) : 0, 5858
Remote Config [baseline] (590.319 µs) : 0, 590
Remote Config [candidate] (578.842 µs) : 0, 579
Telemetry [baseline] (7.873 ms) : 0, 7873
Telemetry [candidate] (7.916 ms) : 0, 7916
section iast_HARDCODED_SECRET_DISABLED
BytebuddyAgent [baseline] (790.71 ms) : 0, 790710
BytebuddyAgent [candidate] (797.405 ms) : 0, 797405
GlobalTracer [baseline] (230.622 ms) : 0, 230622
GlobalTracer [candidate] (232.006 ms) : 0, 232006
IAST [baseline] (22.932 ms) : 0, 22932
IAST [candidate] (23.163 ms) : 0, 23163
AppSec [baseline] (56.802 ms) : 0, 56802
AppSec [candidate] (56.519 ms) : 0, 56519
Debugger [baseline] (5.979 ms) : 0, 5979
Debugger [candidate] (5.893 ms) : 0, 5893
Remote Config [baseline] (592.927 µs) : 0, 593
Remote Config [candidate] (598.819 µs) : 0, 599
Telemetry [baseline] (7.987 ms) : 0, 7987
Telemetry [candidate] (7.868 ms) : 0, 7868
section iast_TELEMETRY_OFF
BytebuddyAgent [baseline] (788.597 ms) : 0, 788597
BytebuddyAgent [candidate] (787.036 ms) : 0, 787036
GlobalTracer [baseline] (230.209 ms) : 0, 230209
GlobalTracer [candidate] (230.114 ms) : 0, 230114
IAST [baseline] (22.352 ms) : 0, 22352
IAST [candidate] (22.366 ms) : 0, 22366
AppSec [baseline] (56.579 ms) : 0, 56579
AppSec [candidate] (56.544 ms) : 0, 56544
Debugger [baseline] (5.946 ms) : 0, 5946
Debugger [candidate] (5.929 ms) : 0, 5929
Remote Config [baseline] (601.614 µs) : 0, 602
Remote Config [candidate] (612.616 µs) : 0, 613
Telemetry [baseline] (7.804 ms) : 0, 7804
Telemetry [candidate] (7.77 ms) : 0, 7770
Startup time reports for petclinicgantt
title petclinic - global startup overhead: candidate=1.49.0-SNAPSHOT~cdc63bd130, baseline=1.49.0-SNAPSHOT~bd7a9c8502
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.004 s) : 0, 1003767
Total [baseline] (10.462 s) : 0, 10462327
Agent [candidate] (1.006 s) : 0, 1005780
Total [candidate] (10.566 s) : 0, 10565552
section appsec
Agent [baseline] (1.152 s) : 0, 1152291
Total [baseline] (10.66 s) : 0, 10659535
Agent [candidate] (1.148 s) : 0, 1148291
Total [candidate] (10.646 s) : 0, 10645751
section iast
Agent [baseline] (1.136 s) : 0, 1136453
Total [baseline] (10.852 s) : 0, 10852399
Agent [candidate] (1.135 s) : 0, 1135380
Total [candidate] (10.874 s) : 0, 10874383
section profiling
Agent [baseline] (1.27 s) : 0, 1270067
Total [baseline] (10.759 s) : 0, 10758583
Agent [candidate] (1.262 s) : 0, 1262274
Total [candidate] (10.757 s) : 0, 10756656
gantt
title petclinic - break down per module: candidate=1.49.0-SNAPSHOT~cdc63bd130, baseline=1.49.0-SNAPSHOT~bd7a9c8502
dateFormat X
axisFormat %s
section tracing
BytebuddyAgent [baseline] (668.836 ms) : 0, 668836
BytebuddyAgent [candidate] (670.45 ms) : 0, 670450
GlobalTracer [baseline] (239.872 ms) : 0, 239872
GlobalTracer [candidate] (240.454 ms) : 0, 240454
AppSec [baseline] (54.332 ms) : 0, 54332
AppSec [candidate] (54.683 ms) : 0, 54683
Debugger [baseline] (6.114 ms) : 0, 6114
Debugger [candidate] (6.177 ms) : 0, 6177
Remote Config [baseline] (701.628 µs) : 0, 702
Remote Config [candidate] (722.98 µs) : 0, 723
Telemetry [baseline] (10.536 ms) : 0, 10536
Telemetry [candidate] (9.907 ms) : 0, 9907
section appsec
BytebuddyAgent [baseline] (690.794 ms) : 0, 690794
BytebuddyAgent [candidate] (687.727 ms) : 0, 687727
GlobalTracer [baseline] (237.183 ms) : 0, 237183
GlobalTracer [candidate] (236.372 ms) : 0, 236372
AppSec [baseline] (176.081 ms) : 0, 176081
AppSec [candidate] (175.322 ms) : 0, 175322
Debugger [baseline] (5.86 ms) : 0, 5860
Debugger [candidate] (5.873 ms) : 0, 5873
Remote Config [baseline] (624.12 µs) : 0, 624
Remote Config [candidate] (631.114 µs) : 0, 631
Telemetry [baseline] (7.364 ms) : 0, 7364
Telemetry [candidate] (8.12 ms) : 0, 8120
IAST [baseline] (21.971 ms) : 0, 21971
IAST [candidate] (21.771 ms) : 0, 21771
section iast
BytebuddyAgent [baseline] (790.026 ms) : 0, 790026
BytebuddyAgent [candidate] (788.521 ms) : 0, 788521
GlobalTracer [baseline] (229.905 ms) : 0, 229905
GlobalTracer [candidate] (230.244 ms) : 0, 230244
AppSec [baseline] (56.193 ms) : 0, 56193
AppSec [candidate] (56.207 ms) : 0, 56207
Debugger [baseline] (5.851 ms) : 0, 5851
Debugger [candidate] (5.846 ms) : 0, 5846
Remote Config [baseline] (596.946 µs) : 0, 597
Remote Config [candidate] (597.855 µs) : 0, 598
Telemetry [baseline] (7.835 ms) : 0, 7835
Telemetry [candidate] (7.863 ms) : 0, 7863
IAST [baseline] (22.595 ms) : 0, 22595
IAST [candidate] (22.684 ms) : 0, 22684
section profiling
BytebuddyAgent [baseline] (672.363 ms) : 0, 672363
BytebuddyAgent [candidate] (667.181 ms) : 0, 667181
GlobalTracer [baseline] (378.523 ms) : 0, 378523
GlobalTracer [candidate] (377.078 ms) : 0, 377078
AppSec [baseline] (55.059 ms) : 0, 55059
AppSec [candidate] (53.785 ms) : 0, 53785
Debugger [baseline] (6.224 ms) : 0, 6224
Debugger [candidate] (6.202 ms) : 0, 6202
Remote Config [baseline] (656.733 µs) : 0, 657
Remote Config [candidate] (671.652 µs) : 0, 672
Telemetry [baseline] (8.294 ms) : 0, 8294
Telemetry [candidate] (8.289 ms) : 0, 8289
ProfilingAgent [baseline] (98.104 ms) : 0, 98104
ProfilingAgent [candidate] (98.603 ms) : 0, 98603
Profiling [baseline] (98.128 ms) : 0, 98128
Profiling [candidate] (98.628 ms) : 0, 98628
LoadParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 12 metrics, 18 unstable metrics. Request duration reports for insecure-bankgantt
title insecure-bank - request duration [CI 0.99] : candidate=1.49.0-SNAPSHOT~cdc63bd130, baseline=1.49.0-SNAPSHOT~bd7a9c8502
dateFormat X
axisFormat %s
section baseline
no_agent (375.121 µs) : 355, 395
. : milestone, 375,
iast (522.0 µs) : 499, 545
. : milestone, 522,
iast_FULL (727.572 µs) : 704, 751
. : milestone, 728,
iast_GLOBAL (569.138 µs) : 546, 592
. : milestone, 569,
iast_HARDCODED_SECRET_DISABLED (510.98 µs) : 488, 534
. : milestone, 511,
iast_INACTIVE (466.673 µs) : 443, 490
. : milestone, 467,
iast_TELEMETRY_OFF (510.579 µs) : 488, 534
. : milestone, 511,
tracing (460.557 µs) : 439, 482
. : milestone, 461,
section candidate
no_agent (377.09 µs) : 357, 397
. : milestone, 377,
iast (506.042 µs) : 483, 529
. : milestone, 506,
iast_FULL (722.309 µs) : 699, 746
. : milestone, 722,
iast_GLOBAL (567.523 µs) : 543, 592
. : milestone, 568,
iast_HARDCODED_SECRET_DISABLED (518.547 µs) : 496, 541
. : milestone, 519,
iast_INACTIVE (467.801 µs) : 445, 491
. : milestone, 468,
iast_TELEMETRY_OFF (496.941 µs) : 474, 520
. : milestone, 497,
tracing (455.916 µs) : 434, 478
. : milestone, 456,
Request duration reports for petclinicgantt
title petclinic - request duration [CI 0.99] : candidate=1.49.0-SNAPSHOT~cdc63bd130, baseline=1.49.0-SNAPSHOT~bd7a9c8502
dateFormat X
axisFormat %s
section baseline
no_agent (1.363 ms) : 1343, 1382
. : milestone, 1363,
appsec (1.744 ms) : 1720, 1768
. : milestone, 1744,
appsec_no_iast (1.708 ms) : 1685, 1732
. : milestone, 1708,
code_origins (1.672 ms) : 1645, 1699
. : milestone, 1672,
iast (1.507 ms) : 1482, 1531
. : milestone, 1507,
profiling (1.508 ms) : 1485, 1532
. : milestone, 1508,
tracing (1.493 ms) : 1469, 1518
. : milestone, 1493,
section candidate
no_agent (1.359 ms) : 1340, 1378
. : milestone, 1359,
appsec (1.727 ms) : 1703, 1751
. : milestone, 1727,
appsec_no_iast (1.723 ms) : 1699, 1747
. : milestone, 1723,
code_origins (1.687 ms) : 1660, 1714
. : milestone, 1687,
iast (1.515 ms) : 1490, 1539
. : milestone, 1515,
profiling (1.534 ms) : 1509, 1558
. : milestone, 1534,
tracing (1.464 ms) : 1439, 1489
. : milestone, 1464,
DacapoParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 12 metrics, 0 unstable metrics. Execution time for biojavagantt
title biojava - execution time [CI 0.99] : candidate=1.49.0-SNAPSHOT~cdc63bd130, baseline=1.49.0-SNAPSHOT~bd7a9c8502
dateFormat X
axisFormat %s
section baseline
no_agent (15.376 s) : 15376000, 15376000
. : milestone, 15376000,
appsec (14.893 s) : 14893000, 14893000
. : milestone, 14893000,
iast (18.571 s) : 18571000, 18571000
. : milestone, 18571000,
iast_GLOBAL (18.13 s) : 18130000, 18130000
. : milestone, 18130000,
profiling (15.145 s) : 15145000, 15145000
. : milestone, 15145000,
tracing (14.912 s) : 14912000, 14912000
. : milestone, 14912000,
section candidate
no_agent (14.698 s) : 14698000, 14698000
. : milestone, 14698000,
appsec (15.172 s) : 15172000, 15172000
. : milestone, 15172000,
iast (18.391 s) : 18391000, 18391000
. : milestone, 18391000,
iast_GLOBAL (18.178 s) : 18178000, 18178000
. : milestone, 18178000,
profiling (15.347 s) : 15347000, 15347000
. : milestone, 15347000,
tracing (15.186 s) : 15186000, 15186000
. : milestone, 15186000,
Execution time for tomcatgantt
title tomcat - execution time [CI 0.99] : candidate=1.49.0-SNAPSHOT~cdc63bd130, baseline=1.49.0-SNAPSHOT~bd7a9c8502
dateFormat X
axisFormat %s
section baseline
no_agent (1.474 ms) : 1463, 1486
. : milestone, 1474,
appsec (2.366 ms) : 2319, 2413
. : milestone, 2366,
iast (2.158 ms) : 2099, 2218
. : milestone, 2158,
iast_GLOBAL (2.2 ms) : 2140, 2260
. : milestone, 2200,
profiling (2.038 ms) : 1988, 2088
. : milestone, 2038,
tracing (1.988 ms) : 1942, 2034
. : milestone, 1988,
section candidate
no_agent (1.471 ms) : 1459, 1482
. : milestone, 1471,
appsec (2.375 ms) : 2328, 2422
. : milestone, 2375,
iast (2.154 ms) : 2094, 2214
. : milestone, 2154,
iast_GLOBAL (2.198 ms) : 2137, 2258
. : milestone, 2198,
profiling (2.01 ms) : 1963, 2058
. : milestone, 2010,
tracing (1.979 ms) : 1933, 2025
. : milestone, 1979,
|
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.
Good catch - and thanks for the detailed description
What Does This Do
Our reactor-core instrumentation needs to access to the
currentContext()
in order to eventually propagate the active span the user can provide under thedd.span
key.The issue, raised by one customer, is that access can eat a lot of cpu time because of the way reactor is working.
In fact, the reactor operators, are nested and for InnerOperators (https://github.com/reactor/reactor-core/blob/718cc691dc3610e6a46636b2e90f1a37bb434669/reactor-core/src/main/java/reactor/core/publisher/InnerOperator.java#L33) the call is delegating to the enclosed one.
This means that on each subscribe and onNext we're calling a lot of method wasting time and causing performance issue.
That PR is addressing the issue by limiting that context access only when needed
Motivation
Additional Notes
Contributor Checklist
type:
and (comp:
orinst:
) labels in addition to any usefull labelsclose
,fix
or any linking keywords when referencing an issue.Use
solves
instead, and assign the PR milestone to the issueJira ticket: AIDM-611