Store accumulator-stage lookups directly#10645
Draft
charlesmyu wants to merge 1 commit intocharles.yu/djm-0000/fix-spark-plan-metricsfrom
Draft
Store accumulator-stage lookups directly#10645charlesmyu wants to merge 1 commit intocharles.yu/djm-0000/fix-spark-plan-metricsfrom
charlesmyu wants to merge 1 commit intocharles.yu/djm-0000/fix-spark-plan-metricsfrom
Conversation
e52fbc5 to
e413d1d
Compare
e1c532c to
9594586
Compare
BenchmarksStartupParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 64 metrics, 7 unstable metrics. Startup time reports for insecure-bankgantt
title insecure-bank - global startup overhead: candidate=1.60.0-SNAPSHOT~95945861cc, baseline=1.60.0-SNAPSHOT~af8b84438c
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.066 s) : 0, 1066046
Total [baseline] (8.764 s) : 0, 8763548
Agent [candidate] (1.067 s) : 0, 1066785
Total [candidate] (8.755 s) : 0, 8755133
section iast
Agent [baseline] (1.232 s) : 0, 1231843
Total [baseline] (9.386 s) : 0, 9385642
Agent [candidate] (1.233 s) : 0, 1232599
Total [candidate] (9.446 s) : 0, 9446333
gantt
title insecure-bank - break down per module: candidate=1.60.0-SNAPSHOT~95945861cc, baseline=1.60.0-SNAPSHOT~af8b84438c
dateFormat X
axisFormat %s
section tracing
crashtracking [baseline] (1.198 ms) : 0, 1198
crashtracking [candidate] (1.2 ms) : 0, 1200
BytebuddyAgent [baseline] (628.428 ms) : 0, 628428
BytebuddyAgent [candidate] (628.236 ms) : 0, 628236
AgentMeter [baseline] (29.038 ms) : 0, 29038
AgentMeter [candidate] (29.184 ms) : 0, 29184
GlobalTracer [baseline] (257.962 ms) : 0, 257962
GlobalTracer [candidate] (258.649 ms) : 0, 258649
AppSec [baseline] (33.074 ms) : 0, 33074
AppSec [candidate] (33.284 ms) : 0, 33284
Debugger [baseline] (65.12 ms) : 0, 65120
Debugger [candidate] (64.289 ms) : 0, 64289
Remote Config [baseline] (617.259 µs) : 0, 617
Remote Config [candidate] (645.919 µs) : 0, 646
Telemetry [baseline] (10.789 ms) : 0, 10789
Telemetry [candidate] (11.454 ms) : 0, 11454
Flare Poller [baseline] (3.781 ms) : 0, 3781
Flare Poller [candidate] (3.747 ms) : 0, 3747
section iast
crashtracking [baseline] (1.201 ms) : 0, 1201
crashtracking [candidate] (1.225 ms) : 0, 1225
BytebuddyAgent [baseline] (795.606 ms) : 0, 795606
BytebuddyAgent [candidate] (796.452 ms) : 0, 796452
AgentMeter [baseline] (11.306 ms) : 0, 11306
AgentMeter [candidate] (11.32 ms) : 0, 11320
GlobalTracer [baseline] (248.309 ms) : 0, 248309
GlobalTracer [candidate] (248.637 ms) : 0, 248637
IAST [baseline] (27.136 ms) : 0, 27136
IAST [candidate] (26.868 ms) : 0, 26868
AppSec [baseline] (33.95 ms) : 0, 33950
AppSec [candidate] (30.931 ms) : 0, 30931
Debugger [baseline] (65.461 ms) : 0, 65461
Debugger [candidate] (68.471 ms) : 0, 68471
Remote Config [baseline] (536.666 µs) : 0, 537
Remote Config [candidate] (540.963 µs) : 0, 541
Telemetry [baseline] (8.712 ms) : 0, 8712
Telemetry [candidate] (8.658 ms) : 0, 8658
Flare Poller [baseline] (3.505 ms) : 0, 3505
Flare Poller [candidate] (3.431 ms) : 0, 3431
Startup time reports for petclinicgantt
title petclinic - global startup overhead: candidate=1.60.0-SNAPSHOT~95945861cc, baseline=1.60.0-SNAPSHOT~af8b84438c
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.065 s) : 0, 1065256
Total [baseline] (10.868 s) : 0, 10868100
Agent [candidate] (1.068 s) : 0, 1068116
Total [candidate] (10.928 s) : 0, 10927590
section appsec
Agent [baseline] (1.244 s) : 0, 1244450
Total [baseline] (11.087 s) : 0, 11087023
Agent [candidate] (1.249 s) : 0, 1248528
Total [candidate] (11.231 s) : 0, 11230850
section iast
Agent [baseline] (1.234 s) : 0, 1233980
Total [baseline] (11.232 s) : 0, 11232017
Agent [candidate] (1.237 s) : 0, 1236895
Total [candidate] (11.268 s) : 0, 11268240
section profiling
Agent [baseline] (1.19 s) : 0, 1189629
Total [baseline] (10.904 s) : 0, 10904423
Agent [candidate] (1.21 s) : 0, 1209853
Total [candidate] (11.073 s) : 0, 11073364
gantt
title petclinic - break down per module: candidate=1.60.0-SNAPSHOT~95945861cc, baseline=1.60.0-SNAPSHOT~af8b84438c
dateFormat X
axisFormat %s
section tracing
crashtracking [baseline] (1.193 ms) : 0, 1193
crashtracking [candidate] (1.198 ms) : 0, 1198
BytebuddyAgent [baseline] (626.34 ms) : 0, 626340
BytebuddyAgent [candidate] (628.286 ms) : 0, 628286
AgentMeter [baseline] (29.065 ms) : 0, 29065
AgentMeter [candidate] (29.096 ms) : 0, 29096
GlobalTracer [baseline] (257.772 ms) : 0, 257772
GlobalTracer [candidate] (258.978 ms) : 0, 258978
AppSec [baseline] (32.976 ms) : 0, 32976
AppSec [candidate] (33.159 ms) : 0, 33159
Debugger [baseline] (66.8 ms) : 0, 66800
Debugger [candidate] (63.912 ms) : 0, 63912
Remote Config [baseline] (626.63 µs) : 0, 627
Remote Config [candidate] (627.933 µs) : 0, 628
Telemetry [baseline] (9.904 ms) : 0, 9904
Telemetry [candidate] (11.474 ms) : 0, 11474
Flare Poller [baseline] (4.511 ms) : 0, 4511
Flare Poller [candidate] (5.305 ms) : 0, 5305
section appsec
crashtracking [baseline] (1.194 ms) : 0, 1194
crashtracking [candidate] (1.212 ms) : 0, 1212
BytebuddyAgent [baseline] (660.34 ms) : 0, 660340
BytebuddyAgent [candidate] (662.473 ms) : 0, 662473
AgentMeter [baseline] (11.998 ms) : 0, 11998
AgentMeter [candidate] (12.031 ms) : 0, 12031
GlobalTracer [baseline] (259.385 ms) : 0, 259385
GlobalTracer [candidate] (260.235 ms) : 0, 260235
IAST [baseline] (25.472 ms) : 0, 25472
IAST [candidate] (25.775 ms) : 0, 25775
AppSec [baseline] (168.896 ms) : 0, 168896
AppSec [candidate] (168.992 ms) : 0, 168992
Debugger [baseline] (67.112 ms) : 0, 67112
Debugger [candidate] (67.474 ms) : 0, 67474
Remote Config [baseline] (650.805 µs) : 0, 651
Remote Config [candidate] (659.237 µs) : 0, 659
Telemetry [baseline] (9.558 ms) : 0, 9558
Telemetry [candidate] (9.653 ms) : 0, 9653
Flare Poller [baseline] (3.723 ms) : 0, 3723
Flare Poller [candidate] (3.8 ms) : 0, 3800
section iast
crashtracking [baseline] (1.203 ms) : 0, 1203
crashtracking [candidate] (1.199 ms) : 0, 1199
BytebuddyAgent [baseline] (797.464 ms) : 0, 797464
BytebuddyAgent [candidate] (796.869 ms) : 0, 796869
AgentMeter [baseline] (11.316 ms) : 0, 11316
AgentMeter [candidate] (11.429 ms) : 0, 11429
GlobalTracer [baseline] (247.873 ms) : 0, 247873
GlobalTracer [candidate] (249.675 ms) : 0, 249675
IAST [baseline] (26.975 ms) : 0, 26975
IAST [candidate] (27.291 ms) : 0, 27291
AppSec [baseline] (32.106 ms) : 0, 32106
AppSec [candidate] (33.828 ms) : 0, 33828
Debugger [baseline] (68.374 ms) : 0, 68374
Debugger [candidate] (67.844 ms) : 0, 67844
Remote Config [baseline] (535.299 µs) : 0, 535
Remote Config [candidate] (544.758 µs) : 0, 545
Telemetry [baseline] (8.631 ms) : 0, 8631
Telemetry [candidate] (8.677 ms) : 0, 8677
Flare Poller [baseline] (3.432 ms) : 0, 3432
Flare Poller [candidate] (3.449 ms) : 0, 3449
section profiling
crashtracking [baseline] (1.191 ms) : 0, 1191
crashtracking [candidate] (1.209 ms) : 0, 1209
BytebuddyAgent [baseline] (681.056 ms) : 0, 681056
BytebuddyAgent [candidate] (693.768 ms) : 0, 693768
AgentMeter [baseline] (8.516 ms) : 0, 8516
AgentMeter [candidate] (8.679 ms) : 0, 8679
GlobalTracer [baseline] (215.733 ms) : 0, 215733
GlobalTracer [candidate] (218.992 ms) : 0, 218992
AppSec [baseline] (32.41 ms) : 0, 32410
AppSec [candidate] (33.321 ms) : 0, 33321
Debugger [baseline] (67.549 ms) : 0, 67549
Debugger [candidate] (68.336 ms) : 0, 68336
Remote Config [baseline] (632.769 µs) : 0, 633
Remote Config [candidate] (646.058 µs) : 0, 646
Telemetry [baseline] (9.001 ms) : 0, 9001
Telemetry [candidate] (9.097 ms) : 0, 9097
Flare Poller [baseline] (3.682 ms) : 0, 3682
Flare Poller [candidate] (3.791 ms) : 0, 3791
ProfilingAgent [baseline] (99.252 ms) : 0, 99252
ProfilingAgent [candidate] (100.5 ms) : 0, 100500
Profiling [baseline] (99.829 ms) : 0, 99829
Profiling [candidate] (101.078 ms) : 0, 101078
LoadParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 18 metrics, 18 unstable metrics. Request duration reports for petclinicgantt
title petclinic - request duration [CI 0.99] : candidate=1.60.0-SNAPSHOT~95945861cc, baseline=1.60.0-SNAPSHOT~af8b84438c
dateFormat X
axisFormat %s
section baseline
no_agent (19.281 ms) : 19084, 19479
. : milestone, 19281,
appsec (18.654 ms) : 18465, 18843
. : milestone, 18654,
code_origins (17.755 ms) : 17580, 17930
. : milestone, 17755,
iast (17.788 ms) : 17608, 17969
. : milestone, 17788,
profiling (18.506 ms) : 18322, 18690
. : milestone, 18506,
tracing (17.309 ms) : 17137, 17481
. : milestone, 17309,
section candidate
no_agent (18.966 ms) : 18772, 19160
. : milestone, 18966,
appsec (18.527 ms) : 18337, 18717
. : milestone, 18527,
code_origins (17.678 ms) : 17500, 17856
. : milestone, 17678,
iast (17.537 ms) : 17363, 17712
. : milestone, 17537,
profiling (18.716 ms) : 18529, 18904
. : milestone, 18716,
tracing (17.348 ms) : 17176, 17519
. : milestone, 17348,
Request duration reports for insecure-bankgantt
title insecure-bank - request duration [CI 0.99] : candidate=1.60.0-SNAPSHOT~95945861cc, baseline=1.60.0-SNAPSHOT~af8b84438c
dateFormat X
axisFormat %s
section baseline
no_agent (1.184 ms) : 1172, 1195
. : milestone, 1184,
iast (3.226 ms) : 3183, 3269
. : milestone, 3226,
iast_FULL (5.765 ms) : 5707, 5822
. : milestone, 5765,
iast_GLOBAL (3.602 ms) : 3541, 3664
. : milestone, 3602,
profiling (2.202 ms) : 2181, 2224
. : milestone, 2202,
tracing (1.753 ms) : 1739, 1767
. : milestone, 1753,
section candidate
no_agent (1.188 ms) : 1177, 1200
. : milestone, 1188,
iast (3.305 ms) : 3267, 3344
. : milestone, 3305,
iast_FULL (5.945 ms) : 5885, 6005
. : milestone, 5945,
iast_GLOBAL (3.61 ms) : 3544, 3676
. : milestone, 3610,
profiling (2.045 ms) : 2026, 2064
. : milestone, 2045,
tracing (1.835 ms) : 1819, 1850
. : milestone, 1835,
DacapoParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 10 metrics, 2 unstable metrics. Execution time for tomcatgantt
title tomcat - execution time [CI 0.99] : candidate=1.60.0-SNAPSHOT~95945861cc, baseline=1.60.0-SNAPSHOT~af8b84438c
dateFormat X
axisFormat %s
section baseline
no_agent (1.478 ms) : 1466, 1490
. : milestone, 1478,
appsec (3.836 ms) : 3608, 4063
. : milestone, 3836,
iast (2.269 ms) : 2200, 2338
. : milestone, 2269,
iast_GLOBAL (2.306 ms) : 2236, 2375
. : milestone, 2306,
profiling (2.524 ms) : 2362, 2686
. : milestone, 2524,
tracing (2.069 ms) : 2015, 2123
. : milestone, 2069,
section candidate
no_agent (1.488 ms) : 1476, 1500
. : milestone, 1488,
appsec (3.783 ms) : 3558, 4008
. : milestone, 3783,
iast (2.275 ms) : 2205, 2345
. : milestone, 2275,
iast_GLOBAL (2.318 ms) : 2248, 2388
. : milestone, 2318,
profiling (2.099 ms) : 2044, 2154
. : milestone, 2099,
tracing (2.073 ms) : 2020, 2127
. : milestone, 2073,
Execution time for biojavagantt
title biojava - execution time [CI 0.99] : candidate=1.60.0-SNAPSHOT~95945861cc, baseline=1.60.0-SNAPSHOT~af8b84438c
dateFormat X
axisFormat %s
section baseline
no_agent (14.76 s) : 14760000, 14760000
. : milestone, 14760000,
appsec (14.319 s) : 14319000, 14319000
. : milestone, 14319000,
iast (18.166 s) : 18166000, 18166000
. : milestone, 18166000,
iast_GLOBAL (17.639 s) : 17639000, 17639000
. : milestone, 17639000,
profiling (14.977 s) : 14977000, 14977000
. : milestone, 14977000,
tracing (14.754 s) : 14754000, 14754000
. : milestone, 14754000,
section candidate
no_agent (15.736 s) : 15736000, 15736000
. : milestone, 15736000,
appsec (15.131 s) : 15131000, 15131000
. : milestone, 15131000,
iast (17.976 s) : 17976000, 17976000
. : milestone, 17976000,
iast_GLOBAL (17.779 s) : 17779000, 17779000
. : milestone, 17779000,
profiling (14.866 s) : 14866000, 14866000
. : milestone, 14866000,
tracing (14.652 s) : 14652000, 14652000
. : milestone, 14652000,
|
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
Stores the map of accumulator ID to stage ID directly in a
Long-Integermap, rather than storing the stage-level accumulators themselves.Motivation
The stage-level accumulators naively roll up metrics from the task level by summing all values. This means they are not accurate in all cases, particular for metrics that are better visualized as a distribution of values across all tasks instead of a single sum.
In #10553 we rollup task-level metrics ourselves and encode them into the Spark SQL metrics as distributions in order to improve the granularity of information collected. This left one remaining use of the stage-level accumulators - mapping operations in Spark SQL plans to their respective stages.
Since we do not need the entire accumulator to accomplish this, we should simplify that to a ID-ID map instead to save space. We can also remove the 50k limit since we are not storing the entire accumulator, allowing us to avoid creating orphaned operations (previously occurred when the
EldestHashMapoverflowed).Additional Notes
I didn't feel the explicit need for a FF here, since the change is fairly straightforwards and shouldn't negatively impact perf. However, if we feel strongly otherwise I'm happy to make that happen.
Contributor Checklist
type:and (comp:orinst:) labels in addition to any other useful labelsclose,fix, or any linking keywords when referencing an issueUse
solvesinstead, and assign the PR milestone to the issueJira ticket: [PROJ-IDENT]
Note: Once your PR is ready to merge, add it to the merge queue by commenting
/merge./merge -ccancels the queue request./merge -f --reason "reason"skips all merge queue checks; please use this judiciously, as some checks do not run at the PR-level. For more information, see this doc.