Remove use of AtomicReferenceArray in RadixTreeCache#10600
Open
Remove use of AtomicReferenceArray in RadixTreeCache#10600
Conversation
Instead we tolerate racing to cache sub-arrays, like we do for individual values. This does mean two or more threads might create the same sub-array, with only one winning, but this should be rare with later calls picking up the same sub-array.
amarziali
approved these changes
Feb 16, 2026
Contributor
amarziali
left a comment
There was a problem hiding this comment.
Looks reasonable to me. At worst we might insert multiple time but it looks idempotent
bric3
approved these changes
Feb 16, 2026
BenchmarksStartupParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 63 metrics, 8 unstable metrics. Startup time reports for petclinicgantt
title petclinic - global startup overhead: candidate=1.60.0-SNAPSHOT~7403c1a852, baseline=1.60.0-SNAPSHOT~ea612c8e95
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.067 s) : 0, 1066835
Total [baseline] (10.951 s) : 0, 10950716
Agent [candidate] (1.065 s) : 0, 1064582
Total [candidate] (10.941 s) : 0, 10940925
section appsec
Agent [baseline] (1.246 s) : 0, 1245745
Total [baseline] (11.052 s) : 0, 11051978
Agent [candidate] (1.243 s) : 0, 1242735
Total [candidate] (11.087 s) : 0, 11086630
section iast
Agent [baseline] (1.241 s) : 0, 1240908
Total [baseline] (11.199 s) : 0, 11198942
Agent [candidate] (1.235 s) : 0, 1235222
Total [candidate] (11.23 s) : 0, 11229918
section profiling
Agent [baseline] (1.188 s) : 0, 1188119
Total [baseline] (10.899 s) : 0, 10898539
Agent [candidate] (1.191 s) : 0, 1190716
Total [candidate] (10.919 s) : 0, 10919346
gantt
title petclinic - break down per module: candidate=1.60.0-SNAPSHOT~7403c1a852, baseline=1.60.0-SNAPSHOT~ea612c8e95
dateFormat X
axisFormat %s
section tracing
crashtracking [baseline] (1.182 ms) : 0, 1182
crashtracking [candidate] (1.18 ms) : 0, 1180
BytebuddyAgent [baseline] (630.012 ms) : 0, 630012
BytebuddyAgent [candidate] (628.836 ms) : 0, 628836
AgentMeter [baseline] (29.038 ms) : 0, 29038
AgentMeter [candidate] (28.966 ms) : 0, 28966
GlobalTracer [baseline] (257.713 ms) : 0, 257713
GlobalTracer [candidate] (257.315 ms) : 0, 257315
AppSec [baseline] (32.94 ms) : 0, 32940
AppSec [candidate] (32.953 ms) : 0, 32953
Debugger [baseline] (63.833 ms) : 0, 63833
Debugger [candidate] (63.277 ms) : 0, 63277
Remote Config [baseline] (631.045 µs) : 0, 631
Remote Config [candidate] (622.011 µs) : 0, 622
Telemetry [baseline] (10.625 ms) : 0, 10625
Telemetry [candidate] (12.24 ms) : 0, 12240
Flare Poller [baseline] (5.438 ms) : 0, 5438
Flare Poller [candidate] (3.785 ms) : 0, 3785
section appsec
crashtracking [baseline] (1.212 ms) : 0, 1212
crashtracking [candidate] (1.183 ms) : 0, 1183
BytebuddyAgent [baseline] (661.781 ms) : 0, 661781
BytebuddyAgent [candidate] (660.512 ms) : 0, 660512
AgentMeter [baseline] (12.037 ms) : 0, 12037
AgentMeter [candidate] (12.03 ms) : 0, 12030
GlobalTracer [baseline] (259.813 ms) : 0, 259813
GlobalTracer [candidate] (258.536 ms) : 0, 258536
AppSec [baseline] (168.72 ms) : 0, 168720
AppSec [candidate] (169.025 ms) : 0, 169025
Debugger [baseline] (67.306 ms) : 0, 67306
Debugger [candidate] (66.534 ms) : 0, 66534
Remote Config [baseline] (646.348 µs) : 0, 646
Remote Config [candidate] (669.31 µs) : 0, 669
Telemetry [baseline] (9.693 ms) : 0, 9693
Telemetry [candidate] (9.654 ms) : 0, 9654
Flare Poller [baseline] (3.716 ms) : 0, 3716
Flare Poller [candidate] (3.674 ms) : 0, 3674
IAST [baseline] (25.252 ms) : 0, 25252
IAST [candidate] (25.458 ms) : 0, 25458
section iast
crashtracking [baseline] (1.195 ms) : 0, 1195
crashtracking [candidate] (1.176 ms) : 0, 1176
BytebuddyAgent [baseline] (803.617 ms) : 0, 803617
BytebuddyAgent [candidate] (797.974 ms) : 0, 797974
AgentMeter [baseline] (11.507 ms) : 0, 11507
AgentMeter [candidate] (11.276 ms) : 0, 11276
GlobalTracer [baseline] (249.075 ms) : 0, 249075
GlobalTracer [candidate] (248.466 ms) : 0, 248466
AppSec [baseline] (34.636 ms) : 0, 34636
AppSec [candidate] (33.88 ms) : 0, 33880
Debugger [baseline] (65.81 ms) : 0, 65810
Debugger [candidate] (67.369 ms) : 0, 67369
Remote Config [baseline] (546.53 µs) : 0, 547
Remote Config [candidate] (545.404 µs) : 0, 545
Telemetry [baseline] (8.605 ms) : 0, 8605
Telemetry [candidate] (8.612 ms) : 0, 8612
Flare Poller [baseline] (3.476 ms) : 0, 3476
Flare Poller [candidate] (3.428 ms) : 0, 3428
IAST [baseline] (26.889 ms) : 0, 26889
IAST [candidate] (27.114 ms) : 0, 27114
section profiling
crashtracking [baseline] (1.206 ms) : 0, 1206
crashtracking [candidate] (1.212 ms) : 0, 1212
BytebuddyAgent [baseline] (681.132 ms) : 0, 681132
BytebuddyAgent [candidate] (682.409 ms) : 0, 682409
AgentMeter [baseline] (8.572 ms) : 0, 8572
AgentMeter [candidate] (8.645 ms) : 0, 8645
GlobalTracer [baseline] (215.487 ms) : 0, 215487
GlobalTracer [candidate] (215.489 ms) : 0, 215489
AppSec [baseline] (32.422 ms) : 0, 32422
AppSec [candidate] (32.715 ms) : 0, 32715
Debugger [baseline] (67.138 ms) : 0, 67138
Debugger [candidate] (67.491 ms) : 0, 67491
Remote Config [baseline] (634.143 µs) : 0, 634
Remote Config [candidate] (634.11 µs) : 0, 634
Telemetry [baseline] (8.959 ms) : 0, 8959
Telemetry [candidate] (9.005 ms) : 0, 9005
Flare Poller [baseline] (3.757 ms) : 0, 3757
Flare Poller [candidate] (3.785 ms) : 0, 3785
ProfilingAgent [baseline] (98.869 ms) : 0, 98869
ProfilingAgent [candidate] (99.397 ms) : 0, 99397
Profiling [baseline] (99.439 ms) : 0, 99439
Profiling [candidate] (99.966 ms) : 0, 99966
Startup time reports for insecure-bankgantt
title insecure-bank - global startup overhead: candidate=1.60.0-SNAPSHOT~7403c1a852, baseline=1.60.0-SNAPSHOT~ea612c8e95
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.072 s) : 0, 1071686
Total [baseline] (8.761 s) : 0, 8761444
Agent [candidate] (1.063 s) : 0, 1063159
Total [candidate] (8.733 s) : 0, 8733126
section iast
Agent [baseline] (1.23 s) : 0, 1230393
Total [baseline] (9.334 s) : 0, 9333606
Agent [candidate] (1.231 s) : 0, 1231228
Total [candidate] (9.377 s) : 0, 9377057
gantt
title insecure-bank - break down per module: candidate=1.60.0-SNAPSHOT~7403c1a852, baseline=1.60.0-SNAPSHOT~ea612c8e95
dateFormat X
axisFormat %s
section tracing
crashtracking [baseline] (1.195 ms) : 0, 1195
crashtracking [candidate] (1.183 ms) : 0, 1183
BytebuddyAgent [baseline] (633.416 ms) : 0, 633416
BytebuddyAgent [candidate] (626.978 ms) : 0, 626978
AgentMeter [baseline] (29.137 ms) : 0, 29137
AgentMeter [candidate] (28.812 ms) : 0, 28812
GlobalTracer [baseline] (258.699 ms) : 0, 258699
GlobalTracer [candidate] (256.82 ms) : 0, 256820
AppSec [baseline] (32.927 ms) : 0, 32927
AppSec [candidate] (32.857 ms) : 0, 32857
Debugger [baseline] (61.499 ms) : 0, 61499
Debugger [candidate] (60.521 ms) : 0, 60521
Remote Config [baseline] (631.227 µs) : 0, 631
Remote Config [candidate] (609.98 µs) : 0, 610
Telemetry [baseline] (11.638 ms) : 0, 11638
Telemetry [candidate] (14.657 ms) : 0, 14657
Flare Poller [baseline] (6.941 ms) : 0, 6941
Flare Poller [candidate] (5.348 ms) : 0, 5348
section iast
crashtracking [baseline] (1.192 ms) : 0, 1192
crashtracking [candidate] (1.181 ms) : 0, 1181
BytebuddyAgent [baseline] (795.342 ms) : 0, 795342
BytebuddyAgent [candidate] (796.146 ms) : 0, 796146
AgentMeter [baseline] (11.238 ms) : 0, 11238
AgentMeter [candidate] (11.23 ms) : 0, 11230
GlobalTracer [baseline] (248.027 ms) : 0, 248027
GlobalTracer [candidate] (248.085 ms) : 0, 248085
AppSec [baseline] (34.942 ms) : 0, 34942
AppSec [candidate] (34.772 ms) : 0, 34772
Debugger [baseline] (64.812 ms) : 0, 64812
Debugger [candidate] (64.765 ms) : 0, 64765
Remote Config [baseline] (535.542 µs) : 0, 536
Remote Config [candidate] (543.764 µs) : 0, 544
Telemetry [baseline] (8.603 ms) : 0, 8603
Telemetry [candidate] (8.63 ms) : 0, 8630
Flare Poller [baseline] (3.459 ms) : 0, 3459
Flare Poller [candidate] (3.514 ms) : 0, 3514
IAST [baseline] (26.879 ms) : 0, 26879
IAST [candidate] (26.981 ms) : 0, 26981
LoadParameters
See matching parameters
SummaryFound 0 performance improvements and 3 performance regressions! Performance is the same for 17 metrics, 16 unstable metrics.
Request duration reports for insecure-bankgantt
title insecure-bank - request duration [CI 0.99] : candidate=1.60.0-SNAPSHOT~7403c1a852, baseline=1.60.0-SNAPSHOT~ea612c8e95
dateFormat X
axisFormat %s
section baseline
no_agent (1.188 ms) : 1176, 1200
. : milestone, 1188,
iast (3.045 ms) : 3004, 3085
. : milestone, 3045,
iast_FULL (5.974 ms) : 5913, 6034
. : milestone, 5974,
iast_GLOBAL (3.44 ms) : 3387, 3494
. : milestone, 3440,
profiling (1.933 ms) : 1915, 1951
. : milestone, 1933,
tracing (1.81 ms) : 1795, 1825
. : milestone, 1810,
section candidate
no_agent (1.188 ms) : 1177, 1199
. : milestone, 1188,
iast (3.234 ms) : 3192, 3276
. : milestone, 3234,
iast_FULL (5.757 ms) : 5699, 5814
. : milestone, 5757,
iast_GLOBAL (3.616 ms) : 3553, 3679
. : milestone, 3616,
profiling (1.938 ms) : 1922, 1955
. : milestone, 1938,
tracing (1.771 ms) : 1757, 1785
. : milestone, 1771,
Request duration reports for petclinicgantt
title petclinic - request duration [CI 0.99] : candidate=1.60.0-SNAPSHOT~7403c1a852, baseline=1.60.0-SNAPSHOT~ea612c8e95
dateFormat X
axisFormat %s
section baseline
no_agent (17.881 ms) : 17700, 18062
. : milestone, 17881,
appsec (19.517 ms) : 19316, 19719
. : milestone, 19517,
code_origins (17.703 ms) : 17526, 17880
. : milestone, 17703,
iast (17.983 ms) : 17804, 18162
. : milestone, 17983,
profiling (18.746 ms) : 18555, 18936
. : milestone, 18746,
tracing (17.439 ms) : 17265, 17613
. : milestone, 17439,
section candidate
no_agent (17.071 ms) : 16899, 17242
. : milestone, 17071,
appsec (18.874 ms) : 18683, 19065
. : milestone, 18874,
code_origins (17.652 ms) : 17477, 17828
. : milestone, 17652,
iast (17.56 ms) : 17389, 17732
. : milestone, 17560,
profiling (19.219 ms) : 19026, 19412
. : milestone, 19219,
tracing (17.633 ms) : 17457, 17809
. : milestone, 17633,
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.60.0-SNAPSHOT~7403c1a852, baseline=1.60.0-SNAPSHOT~ea612c8e95
dateFormat X
axisFormat %s
section baseline
no_agent (1.467 ms) : 1455, 1478
. : milestone, 1467,
appsec (3.7 ms) : 3483, 3916
. : milestone, 3700,
iast (2.238 ms) : 2169, 2307
. : milestone, 2238,
iast_GLOBAL (2.281 ms) : 2212, 2350
. : milestone, 2281,
profiling (2.065 ms) : 2010, 2119
. : milestone, 2065,
tracing (2.045 ms) : 1992, 2098
. : milestone, 2045,
section candidate
no_agent (1.471 ms) : 1459, 1482
. : milestone, 1471,
appsec (3.743 ms) : 3522, 3964
. : milestone, 3743,
iast (2.249 ms) : 2180, 2318
. : milestone, 2249,
iast_GLOBAL (2.275 ms) : 2206, 2344
. : milestone, 2275,
profiling (2.083 ms) : 2028, 2138
. : milestone, 2083,
tracing (2.055 ms) : 2001, 2109
. : milestone, 2055,
Execution time for biojavagantt
title biojava - execution time [CI 0.99] : candidate=1.60.0-SNAPSHOT~7403c1a852, baseline=1.60.0-SNAPSHOT~ea612c8e95
dateFormat X
axisFormat %s
section baseline
no_agent (15.036 s) : 15036000, 15036000
. : milestone, 15036000,
appsec (15.072 s) : 15072000, 15072000
. : milestone, 15072000,
iast (18.145 s) : 18145000, 18145000
. : milestone, 18145000,
iast_GLOBAL (17.955 s) : 17955000, 17955000
. : milestone, 17955000,
profiling (14.954 s) : 14954000, 14954000
. : milestone, 14954000,
tracing (14.889 s) : 14889000, 14889000
. : milestone, 14889000,
section candidate
no_agent (14.965 s) : 14965000, 14965000
. : milestone, 14965000,
appsec (14.905 s) : 14905000, 14905000
. : milestone, 14905000,
iast (18.028 s) : 18028000, 18028000
. : milestone, 18028000,
iast_GLOBAL (17.968 s) : 17968000, 17968000
. : milestone, 17968000,
profiling (14.928 s) : 14928000, 14928000
. : milestone, 14928000,
tracing (14.725 s) : 14725000, 14725000
. : milestone, 14725000,
|
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
Instead we tolerate racing to cache sub-arrays, like we do for individual values. This does mean two or more threads might create the same sub-array, with only one winning, but this should be rare with later calls picking up the same sub-array.
Motivation
Ongoing issues on Semeru related to behaviour of
AtomicReferenceArray.Benchmarks show removing
AtomicReferenceArrayspeeds up the cache, at the expense of recreating a few sub-arrays and their cached values when there is initial contention. Since these sub-arrays are small and we already created new arrays before the compare-and-swap, the issue is more about losing some cached values in the overwritten sub-array.We already tolerate racing to cache these values - so IMHO this is an acceptable simplification.
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.