List iteration benchmark#10888
Conversation
BenchmarksStartupParameters
See matching parameters
SummaryFound 8 performance improvements and 1 performance regressions! Performance is the same for 48 metrics, 14 unstable metrics.
Startup time reports for petclinicgantt
title petclinic - global startup overhead: candidate=1.61.0-SNAPSHOT~b816fdeed7, baseline=1.64.0-SNAPSHOT~ea827ba0c4
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.071 s) : 0, 1071462
Total [baseline] (10.964 s) : 0, 10963509
Agent [candidate] (1.059 s) : 0, 1058573
Total [candidate] (11.025 s) : 0, 11024502
section appsec
Agent [baseline] (1.274 s) : 0, 1273545
Total [baseline] (10.951 s) : 0, 10950504
Agent [candidate] (1.248 s) : 0, 1248302
Total [candidate] (11.196 s) : 0, 11195889
section iast
Agent [baseline] (1.256 s) : 0, 1256403
Total [baseline] (11.352 s) : 0, 11352370
Agent [candidate] (1.231 s) : 0, 1231317
Total [candidate] (11.294 s) : 0, 11294026
section profiling
Agent [baseline] (1.328 s) : 0, 1327526
Total [baseline] (11.145 s) : 0, 11144568
Agent [candidate] (1.2 s) : 0, 1200335
Total [candidate] (11.019 s) : 0, 11018783
gantt
title petclinic - break down per module: candidate=1.61.0-SNAPSHOT~b816fdeed7, baseline=1.64.0-SNAPSHOT~ea827ba0c4
dateFormat X
axisFormat %s
section tracing
crashtracking [baseline] (1.22 ms) : 0, 1220
crashtracking [candidate] (1.229 ms) : 0, 1229
BytebuddyAgent [baseline] (641.003 ms) : 0, 641003
BytebuddyAgent [candidate] (632.476 ms) : 0, 632476
AgentMeter [baseline] (30.144 ms) : 0, 30144
AgentMeter [candidate] (29.277 ms) : 0, 29277
GlobalTracer [baseline] (249.378 ms) : 0, 249378
GlobalTracer [candidate] (248.848 ms) : 0, 248848
AppSec [baseline] (32.293 ms) : 0, 32293
AppSec [candidate] (32.083 ms) : 0, 32083
Debugger [baseline] (60.37 ms) : 0, 60370
Debugger [candidate] (59.862 ms) : 0, 59862
Remote Config [baseline] (589.811 µs) : 0, 590
Remote Config [candidate] (600.01 µs) : 0, 600
Telemetry [baseline] (8.477 ms) : 0, 8477
Telemetry [candidate] (8.058 ms) : 0, 8058
Flare Poller [baseline] (11.208 ms) : 0, 11208
Flare Poller [candidate] (9.887 ms) : 0, 9887
section appsec
crashtracking [baseline] (1.19 ms) : 0, 1190
crashtracking [candidate] (1.233 ms) : 0, 1233
BytebuddyAgent [baseline] (679.024 ms) : 0, 679024
BytebuddyAgent [candidate] (662.427 ms) : 0, 662427
AgentMeter [baseline] (12.143 ms) : 0, 12143
AgentMeter [candidate] (12.006 ms) : 0, 12006
GlobalTracer [baseline] (247.96 ms) : 0, 247960
GlobalTracer [candidate] (248.988 ms) : 0, 248988
AppSec [baseline] (189.223 ms) : 0, 189223
AppSec [candidate] (184.125 ms) : 0, 184125
Debugger [baseline] (65.148 ms) : 0, 65148
Debugger [candidate] (65.962 ms) : 0, 65962
Remote Config [baseline] (579.344 µs) : 0, 579
Remote Config [candidate] (599.113 µs) : 0, 599
Telemetry [baseline] (7.947 ms) : 0, 7947
Telemetry [candidate] (8.516 ms) : 0, 8516
Flare Poller [baseline] (9.258 ms) : 0, 9258
Flare Poller [candidate] (3.535 ms) : 0, 3535
IAST [baseline] (24.276 ms) : 0, 24276
IAST [candidate] (24.614 ms) : 0, 24614
section iast
crashtracking [baseline] (1.204 ms) : 0, 1204
crashtracking [candidate] (1.236 ms) : 0, 1236
BytebuddyAgent [baseline] (834.191 ms) : 0, 834191
BytebuddyAgent [candidate] (806.659 ms) : 0, 806659
AgentMeter [baseline] (11.651 ms) : 0, 11651
AgentMeter [candidate] (11.512 ms) : 0, 11512
GlobalTracer [baseline] (243.944 ms) : 0, 243944
GlobalTracer [candidate] (240.19 ms) : 0, 240190
AppSec [baseline] (25.854 ms) : 0, 25854
AppSec [candidate] (31.689 ms) : 0, 31689
Debugger [baseline] (64.122 ms) : 0, 64122
Debugger [candidate] (61.991 ms) : 0, 61991
Remote Config [baseline] (521.402 µs) : 0, 521
Remote Config [candidate] (532.639 µs) : 0, 533
Telemetry [baseline] (7.879 ms) : 0, 7879
Telemetry [candidate] (11.667 ms) : 0, 11667
Flare Poller [baseline] (3.323 ms) : 0, 3323
Flare Poller [candidate] (3.463 ms) : 0, 3463
IAST [baseline] (26.943 ms) : 0, 26943
IAST [candidate] (25.878 ms) : 0, 25878
section profiling
crashtracking [baseline] (549.919 µs) : 0, 550
crashtracking [candidate] (1.196 ms) : 0, 1196
BytebuddyAgent [baseline] (695.831 ms) : 0, 695831
BytebuddyAgent [candidate] (701.345 ms) : 0, 701345
AgentMeter [baseline] (9.943 ms) : 0, 9943
AgentMeter [candidate] (9.275 ms) : 0, 9275
GlobalTracer [baseline] (211.113 ms) : 0, 211113
GlobalTracer [candidate] (210.042 ms) : 0, 210042
AppSec [baseline] (32.742 ms) : 0, 32742
AppSec [candidate] (32.822 ms) : 0, 32822
Debugger [baseline] (66.641 ms) : 0, 66641
Debugger [candidate] (66.157 ms) : 0, 66157
Remote Config [baseline] (620.472 µs) : 0, 620
Remote Config [candidate] (575.852 µs) : 0, 576
Telemetry [baseline] (8.057 ms) : 0, 8057
Telemetry [candidate] (7.995 ms) : 0, 7995
Flare Poller [baseline] (3.597 ms) : 0, 3597
Flare Poller [candidate] (3.614 ms) : 0, 3614
ProfilingAgent [baseline] (96.023 ms) : 0, 96023
ProfilingAgent [candidate] (95.093 ms) : 0, 95093
Profiling [baseline] (96.583 ms) : 0, 96583
Profiling [candidate] (95.673 ms) : 0, 95673
Startup time reports for insecure-bankgantt
title insecure-bank - global startup overhead: candidate=1.61.0-SNAPSHOT~b816fdeed7, baseline=1.64.0-SNAPSHOT~ea827ba0c4
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.066 s) : 0, 1066231
Total [baseline] (8.871 s) : 0, 8871250
Agent [candidate] (1.067 s) : 0, 1067439
Total [candidate] (8.855 s) : 0, 8855192
section iast
Agent [baseline] (1.246 s) : 0, 1246472
Total [baseline] (9.491 s) : 0, 9490893
Agent [candidate] (1.225 s) : 0, 1224996
Total [candidate] (9.576 s) : 0, 9576358
gantt
title insecure-bank - break down per module: candidate=1.61.0-SNAPSHOT~b816fdeed7, baseline=1.64.0-SNAPSHOT~ea827ba0c4
dateFormat X
axisFormat %s
section tracing
crashtracking [baseline] (1.208 ms) : 0, 1208
crashtracking [candidate] (1.237 ms) : 0, 1237
BytebuddyAgent [baseline] (638.433 ms) : 0, 638433
BytebuddyAgent [candidate] (639.455 ms) : 0, 639455
AgentMeter [baseline] (29.851 ms) : 0, 29851
AgentMeter [candidate] (29.77 ms) : 0, 29770
GlobalTracer [baseline] (247.817 ms) : 0, 247817
GlobalTracer [candidate] (251.511 ms) : 0, 251511
AppSec [baseline] (32.266 ms) : 0, 32266
AppSec [candidate] (32.381 ms) : 0, 32381
Debugger [baseline] (59.64 ms) : 0, 59640
Debugger [candidate] (59.711 ms) : 0, 59711
Remote Config [baseline] (601.099 µs) : 0, 601
Remote Config [candidate] (605.219 µs) : 0, 605
Telemetry [baseline] (8.466 ms) : 0, 8466
Telemetry [candidate] (8.224 ms) : 0, 8224
Flare Poller [baseline] (11.22 ms) : 0, 11220
Flare Poller [candidate] (8.257 ms) : 0, 8257
section iast
crashtracking [baseline] (1.216 ms) : 0, 1216
crashtracking [candidate] (1.217 ms) : 0, 1217
BytebuddyAgent [baseline] (826.921 ms) : 0, 826921
BytebuddyAgent [candidate] (800.992 ms) : 0, 800992
AgentMeter [baseline] (11.483 ms) : 0, 11483
AgentMeter [candidate] (11.46 ms) : 0, 11460
GlobalTracer [baseline] (238.777 ms) : 0, 238777
GlobalTracer [candidate] (239.791 ms) : 0, 239791
AppSec [baseline] (28.063 ms) : 0, 28063
AppSec [candidate] (31.177 ms) : 0, 31177
Debugger [baseline] (63.063 ms) : 0, 63063
Debugger [candidate] (59.89 ms) : 0, 59890
Remote Config [baseline] (524.688 µs) : 0, 525
Remote Config [candidate] (1.145 ms) : 0, 1145
Telemetry [baseline] (7.753 ms) : 0, 7753
Telemetry [candidate] (13.668 ms) : 0, 13668
Flare Poller [baseline] (3.279 ms) : 0, 3279
Flare Poller [candidate] (3.656 ms) : 0, 3656
IAST [baseline] (28.679 ms) : 0, 28679
IAST [candidate] (25.851 ms) : 0, 25851
LoadParameters
See matching parameters
SummaryFound 0 performance improvements and 6 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~b816fdeed7, baseline=1.64.0-SNAPSHOT~ea827ba0c4
dateFormat X
axisFormat %s
section baseline
no_agent (1.278 ms) : 1266, 1291
. : milestone, 1278,
iast (3.355 ms) : 3303, 3407
. : milestone, 3355,
iast_FULL (6.063 ms) : 6001, 6125
. : milestone, 6063,
iast_GLOBAL (3.583 ms) : 3536, 3630
. : milestone, 3583,
profiling (2.161 ms) : 2141, 2181
. : milestone, 2161,
tracing (1.929 ms) : 1912, 1945
. : milestone, 1929,
section candidate
no_agent (1.276 ms) : 1263, 1288
. : milestone, 1276,
iast (3.327 ms) : 3280, 3374
. : milestone, 3327,
iast_FULL (6.516 ms) : 6447, 6584
. : milestone, 6516,
iast_GLOBAL (3.631 ms) : 3571, 3691
. : milestone, 3631,
profiling (2.348 ms) : 2324, 2373
. : milestone, 2348,
tracing (1.935 ms) : 1918, 1953
. : milestone, 1935,
Request duration reports for petclinicgantt
title petclinic - request duration [CI 0.99] : candidate=1.61.0-SNAPSHOT~b816fdeed7, baseline=1.64.0-SNAPSHOT~ea827ba0c4
dateFormat X
axisFormat %s
section baseline
no_agent (18.013 ms) : 17834, 18193
. : milestone, 18013,
appsec (18.655 ms) : 18467, 18843
. : milestone, 18655,
code_origins (18.848 ms) : 18659, 19038
. : milestone, 18848,
iast (17.888 ms) : 17715, 18062
. : milestone, 17888,
profiling (18.281 ms) : 18097, 18464
. : milestone, 18281,
tracing (17.929 ms) : 17755, 18104
. : milestone, 17929,
section candidate
no_agent (19.146 ms) : 18949, 19342
. : milestone, 19146,
appsec (18.559 ms) : 18373, 18745
. : milestone, 18559,
code_origins (18.047 ms) : 17867, 18227
. : milestone, 18047,
iast (18.709 ms) : 18522, 18896
. : milestone, 18709,
profiling (20.165 ms) : 19964, 20365
. : milestone, 20165,
tracing (17.753 ms) : 17577, 17928
. : milestone, 17753,
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.61.0-SNAPSHOT~b816fdeed7, baseline=1.64.0-SNAPSHOT~ea827ba0c4
dateFormat X
axisFormat %s
section baseline
no_agent (1.491 ms) : 1479, 1502
. : milestone, 1491,
appsec (3.856 ms) : 3631, 4080
. : milestone, 3856,
iast (2.294 ms) : 2224, 2365
. : milestone, 2294,
iast_GLOBAL (2.33 ms) : 2258, 2401
. : milestone, 2330,
profiling (2.563 ms) : 2397, 2728
. : milestone, 2563,
tracing (2.118 ms) : 2063, 2173
. : milestone, 2118,
section candidate
no_agent (1.497 ms) : 1486, 1509
. : milestone, 1497,
appsec (3.815 ms) : 3589, 4040
. : milestone, 3815,
iast (2.277 ms) : 2208, 2346
. : milestone, 2277,
iast_GLOBAL (2.318 ms) : 2248, 2387
. : milestone, 2318,
profiling (2.098 ms) : 2043, 2153
. : milestone, 2098,
tracing (2.069 ms) : 2016, 2122
. : milestone, 2069,
Execution time for biojavagantt
title biojava - execution time [CI 0.99] : candidate=1.61.0-SNAPSHOT~b816fdeed7, baseline=1.64.0-SNAPSHOT~ea827ba0c4
dateFormat X
axisFormat %s
section baseline
no_agent (14.946 s) : 14946000, 14946000
. : milestone, 14946000,
appsec (14.885 s) : 14885000, 14885000
. : milestone, 14885000,
iast (18.649 s) : 18649000, 18649000
. : milestone, 18649000,
iast_GLOBAL (18.034 s) : 18034000, 18034000
. : milestone, 18034000,
profiling (14.961 s) : 14961000, 14961000
. : milestone, 14961000,
tracing (14.741 s) : 14741000, 14741000
. : milestone, 14741000,
section candidate
no_agent (15.423 s) : 15423000, 15423000
. : milestone, 15423000,
appsec (14.776 s) : 14776000, 14776000
. : milestone, 14776000,
iast (18.147 s) : 18147000, 18147000
. : milestone, 18147000,
iast_GLOBAL (18.005 s) : 18005000, 18005000
. : milestone, 18005000,
profiling (15.464 s) : 15464000, 15464000
. : milestone, 15464000,
tracing (15.052 s) : 15052000, 15052000
. : milestone, 15052000,
|
Adding missing end ul to doc Moving iterator benchmarks next to enhancedFor
…dd-trace-java into dougqh/list-iteration-benchmark
…hmark.java Co-authored-by: Sarah Chen <sarah.chen@datadoghq.com>
…hmark.java Co-authored-by: Sarah Chen <sarah.chen@datadoghq.com>
This comment has been minimized.
This comment has been minimized.
🟢 Java Benchmark SLOs — All performance SLOs passed
PR vs. master results
Commit: Load and DaCapo benchmarks can be triggered manually in the GitLab pipeline. Results will appear in the Benchmarking Platform UI after completion. |
| @Warmup(iterations = 2) | ||
| @Measurement(iterations = 3) | ||
| @Threads(8) | ||
| @State(Scope.Benchmark) |
There was a problem hiding this comment.
Would it be better to use @State(Scope.Thread) here to avoid different benchmarks iterating on the same fields?
There was a problem hiding this comment.
Yeah, that might be a more realistic comparison.
For maps, I think the shared map has some merit for the precomputed case, but that doesn't so much apply to lists.
…hmark.java Co-authored-by: Sarah Chen <sarah.chen@datadoghq.com>
Build each thread's list (and its Elements) in a Scope.Thread @setup so the manipulate_* mutations stay thread-local. Previously the lists lived in enum constants shared across all 8 threads, so the benchmark measured cross-thread contention on Element.num rather than iteration cost. Also bump to @fork(2) and fix a Javadoc typo. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
sarahchen6
left a comment
There was a problem hiding this comment.
I assume the numbers need to be updated with the new changes, but pre-approving!
@sarahchen6 |
What Does This Do
Benchmark examining different ways to iterate over Lists:
Collections.emptyList,Collections.singletonList, andArrayListof different sizesCovers multiple iteration options...
Each benchmark has a variation with and without the loop body fully inlined
Motivation
Illustrate overhead and make recommendations about the preferred way to iterate over lists in dd-java-agent.
Additional Notes
Recommends are...
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.