Skip to content

Replace JCTools queues with VarHandle-based implementations for Java 25+#9896

Merged
amarziali merged 42 commits intomasterfrom
andrea.marziali/remove-jctools-queues
Jan 22, 2026
Merged

Replace JCTools queues with VarHandle-based implementations for Java 25+#9896
amarziali merged 42 commits intomasterfrom
andrea.marziali/remove-jctools-queues

Conversation

@amarziali
Copy link
Contributor

@amarziali amarziali commented Nov 3, 2025

What Does This Do

This PR introduces a set of queue implementations in order to replace the JCTools-based queues, eliminating direct usage of sun.misc.Unsafe and providing full compatibility with Java 9+ runtimes through the VarHandle API.

The goal is to achieve similar high-performance concurrent queue behavior as JCTools while using supported, standard Java mechanisms.

A new Queues factory class is introduced to dynamically select the optimal queue implementation based on the Java runtime environment:

  • On Java 25 and newer, the factory instantiates the new VarHandle-based queues
  • On Java 1.8, it falls back to the existing JCTools-based queues to maintain backward compatibility and performance consistency.

Introduced Classes Summary

Class Pattern Description
SpscArrayQueueVarHandle Single-Producer / Single-Consumer Wait-free queue optimized for single-threaded access on both ends. Uses acquire/release semantics for minimal memory ordering overhead.
SpmcArrayQueueVarHandle Single-Producer / Multiple-Consumer Wait-free producer with lock-free consumers competing via CAS on the head index. Uses cached consumerLimit to reduce contention on producer index reads.
MpscArrayQueueVarHandle<E> Multiple-Producer / Single-Consumer Lock-free producers compete via CAS on the tail index, with a wait-free consumer. Maintains cached producerLimit to minimize expensive head index reads.
MpscBlockingConsumerArrayQueueVarHandle<E> Multiple-Producer / Single-Consumer (Blocking) MPSC queue with efficient blocking support for the consumer. Uses the low bit of the producer index to signal blocked state, enabling producers to wake the consumer via LockSupport.unpark() without locks.

Memory Padding

All queue state fields (head, tail, cached limits, etc.) are cache-line padded to prevent false sharing between producers and consumers.
This ensures that frequently accessed hot fields do not reside on the same cache line across threads, minimizing cache invalidations and improving throughput under contention.

Memory Ordering Semantics

VarHandle access modes are carefully chosen to balance performance and correctness, using the weakest ordering that maintains visibility guarantees:

  • setRelease / getAcquire — Element publication and consumption. Release stores guarantee all preceding writes are visible before the element, while acquire loads ensure all subsequent reads see the published data. Provides efficient producer-consumer synchronization without full memory barriers.
  • getOpaque — Hot-path reads of cached limits and blocked state. Ensures atomic access and eventual visibility without memory fence overhead. Safe when stale reads are benign (e.g., cached producerLimit triggers recalculation on mismatch, or when subsequent CAS provides full synchronization).
  • getVolatile — Synchronization points requiring immediate visibility. Used when refreshing producer/consumer limits or checking queue state where correctness depends on seeing the latest value from other threads. Provides sequential consistency with full memory barriers.
  • Plain access (get / set) — Single-threaded paths where no inter-thread coordination is needed (e.g., single consumer reading its own index).

Queue Benchmark Results

SPSC (Single-Producer / Single-Consumer)

Capacity = 1024
Operation JCTools (ops/us ± err) VarHandle (ops/us ± err)
Total 285,696 ± 397,530 180,354 ± 315,780
Produce 141,966 ± 205,795 89,810 ± 160,517
Consume 143,730 ± 191,736 90,544 ± 155,265
Capacity = 65536
Operation JCTools (ops/us ± err) VarHandle (ops/us ± err)
Total 546,439 ± 304,146 449,770 ± 4,365
Produce 273,143 ± 152,509 224,833 ± 2,992
Consume 273,296 ± 151,645 224,937 ± 1,432

MPSC (Multi-Producer / Single-Consumer)

Capacity = 1024
Operation JCTools (ops/us ± err) VarHandle (ops/us ± err)
Total 26,429 ± 24,149 19,453 ± 31,615
Produce 8,919 ± 3,046 8,055 ± 12,486
Consume 17,510 ± 23,328 11,398 ± 40,952
Capacity = 65536
Operation JCTools (ops/us ± err) VarHandle (ops/us ± err)
Total 24,071 ± 71,594 22,795 ± 55,130
Produce 7,361 ± 18,533 7,604 ± 4,840
Consume 16,710 ± 88,477 15,191 ± 59,717

MPSC (Blocking Consumer)

Capacity = 1024
Operation JCTools (ops/us ± err) VarHandle (ops/us ± err)
Total 31,150 ± 211,089 18,202 ± 11,319
Produce 7,244 ± 9,645 8,066 ± 14,697
Consume 23,906 ± 215,572 10,136 ± 5,535
Capacity = 65536
Operation JCTools (ops/us ± err) VarHandle (ops/us ± err)
Total 27,277 ± 69,378 19,187 ± 40,915
Produce 6,224 ± 11,748 7,300 ± 9,286
Consume 21,053 ± 64,255 11,887 ± 39,520

Takeaways:

  • MPSC queues can be replaced with a VarHandle equivalent. In some cases, the new implementation shows even better performances.
  • jctools still outperforms generally speaking. However the measurements show a high error variance. Better tests can be done by increasing the iterations and/or the forks

Motivation

Additional Notes

Contributor Checklist

Jira ticket: [PROJ-IDENT]

@datadog-datadog-prod-us1

This comment has been minimized.

@pr-commenter
Copy link

pr-commenter bot commented Nov 3, 2025

Debugger benchmarks

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
ci_job_date 1762350659 1762351004
end_time 2025-11-05T13:52:20 2025-11-05T13:58:05
git_branch master andrea.marziali/remove-jctools-queues
git_commit_sha 8db72c0 a880c67
start_time 2025-11-05T13:51:00 2025-11-05T13:56:45
See matching parameters
Baseline Candidate
ci_job_id 1217030429 1217030429
ci_pipeline_id 81317491 81317491
cpu_model Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz
git_commit_date 1762349967 1762349967

Summary

Found 0 performance improvements and 0 performance regressions! Performance is the same for 10 metrics, 5 unstable metrics.

See unchanged results
scenario Δ mean agg_http_req_duration_min Δ mean agg_http_req_duration_p50 Δ mean agg_http_req_duration_p75 Δ mean agg_http_req_duration_p99 Δ mean throughput
scenario:noprobe unstable
[-16.952µs; +19.877µs] or [-6.074%; +7.122%]
unstable
[-27.156µs; +31.309µs] or [-8.553%; +9.861%]
unstable
[-36.996µs; +42.158µs] or [-11.187%; +12.748%]
unstable
[-142.099µs; +61.104µs] or [-13.747%; +5.911%]
same
scenario:basic same same same unstable
[-226.500µs; -8.890µs] or [-25.732%; -1.010%]
same
scenario:loop unsure
[+0.257µs; +4.484µs] or [+0.003%; +0.051%]
unsure
[-7.436µs; -0.629µs] or [-0.083%; -0.007%]
unsure
[-8.505µs; -0.543µs] or [-0.094%; -0.006%]
same same
Request duration reports for reports
gantt
    title reports - request duration [CI 0.99] : candidate=None, baseline=None
    dateFormat X
    axisFormat %s
section baseline
noprobe (317.508 µs) : 291, 344
.   : milestone, 318,
basic (294.053 µs) : 287, 301
.   : milestone, 294,
loop (8.959 ms) : 8956, 8963
.   : milestone, 8959,
section candidate
noprobe (319.585 µs) : 290, 349
.   : milestone, 320,
basic (293.196 µs) : 286, 300
.   : milestone, 293,
loop (8.955 ms) : 8952, 8958
.   : milestone, 8955,
Loading
  • baseline results
Scenario Request median duration [CI 0.99]
noprobe 317.508 µs [291.339 µs, 343.677 µs]
basic 294.053 µs [286.681 µs, 301.425 µs]
loop 8.959 ms [8.956 ms, 8.963 ms]
  • candidate results
Scenario Request median duration [CI 0.99]
noprobe 319.585 µs [290.19 µs, 348.98 µs]
basic 293.196 µs [286.34 µs, 300.053 µs]
loop 8.955 ms [8.952 ms, 8.958 ms]

@pr-commenter
Copy link

pr-commenter bot commented Nov 3, 2025

Benchmarks

Startup

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
git_branch master andrea.marziali/remove-jctools-queues
git_commit_date 1769006261 1769083203
git_commit_sha c91ab36 f8d77fd
release_version 1.59.0-SNAPSHOT~c91ab36874 1.57.0-SNAPSHOT~f8d77fd44e
See matching parameters
Baseline Candidate
application insecure-bank insecure-bank
ci_job_date 1769085198 1769085198
ci_job_id 1369554907 1369554907
ci_pipeline_id 92240027 92240027
cpu_model Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz
kernel_version Linux runner-zfyrx7zua-project-304-concurrent-0-2f9igf3m 6.8.0-1031-aws #33~22.04.1-Ubuntu SMP Thu Jun 26 14:22:30 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux Linux runner-zfyrx7zua-project-304-concurrent-0-2f9igf3m 6.8.0-1031-aws #33~22.04.1-Ubuntu SMP Thu Jun 26 14:22:30 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
module Agent Agent
parent None None

Summary

Found 0 performance improvements and 0 performance regressions! Performance is the same for 55 metrics, 10 unstable metrics.

Startup time reports for petclinic
gantt
    title petclinic - global startup overhead: candidate=1.57.0-SNAPSHOT~f8d77fd44e, baseline=1.59.0-SNAPSHOT~c91ab36874

    dateFormat X
    axisFormat %s
section tracing
Agent [baseline] (1.092 s) : 0, 1092483
Total [baseline] (10.853 s) : 0, 10852937
Agent [candidate] (1.088 s) : 0, 1088289
Total [candidate] (10.87 s) : 0, 10869797
section appsec
Agent [baseline] (1.264 s) : 0, 1263897
Total [baseline] (11.021 s) : 0, 11020649
Agent [candidate] (1.269 s) : 0, 1269351
Total [candidate] (11.086 s) : 0, 11086130
section iast
Agent [baseline] (1.228 s) : 0, 1227596
Total [baseline] (11.193 s) : 0, 11192880
Agent [candidate] (1.229 s) : 0, 1228831
Total [candidate] (11.199 s) : 0, 11198627
section profiling
Agent [baseline] (1.216 s) : 0, 1216203
Total [baseline] (11.121 s) : 0, 11120523
Agent [candidate] (1.21 s) : 0, 1209945
Total [candidate] (10.891 s) : 0, 10891468
Loading
  • baseline results
Module Variant Duration Δ tracing
Agent tracing 1.092 s -
Agent appsec 1.264 s 171.414 ms (15.7%)
Agent iast 1.228 s 135.113 ms (12.4%)
Agent profiling 1.216 s 123.72 ms (11.3%)
Total tracing 10.853 s -
Total appsec 11.021 s 167.712 ms (1.5%)
Total iast 11.193 s 339.943 ms (3.1%)
Total profiling 11.121 s 267.586 ms (2.5%)
  • candidate results
Module Variant Duration Δ tracing
Agent tracing 1.088 s -
Agent appsec 1.269 s 181.062 ms (16.6%)
Agent iast 1.229 s 140.542 ms (12.9%)
Agent profiling 1.21 s 121.656 ms (11.2%)
Total tracing 10.87 s -
Total appsec 11.086 s 216.334 ms (2.0%)
Total iast 11.199 s 328.83 ms (3.0%)
Total profiling 10.891 s 21.671 ms (0.2%)
gantt
    title petclinic - break down per module: candidate=1.57.0-SNAPSHOT~f8d77fd44e, baseline=1.59.0-SNAPSHOT~c91ab36874

    dateFormat X
    axisFormat %s
section tracing
crashtracking [baseline] (1.189 ms) : 0, 1189
crashtracking [candidate] (1.18 ms) : 0, 1180
BytebuddyAgent [baseline] (656.487 ms) : 0, 656487
BytebuddyAgent [candidate] (652.877 ms) : 0, 652877
GlobalTracer [baseline] (284.913 ms) : 0, 284913
GlobalTracer [candidate] (284.36 ms) : 0, 284360
AppSec [baseline] (32.817 ms) : 0, 32817
AppSec [candidate] (32.601 ms) : 0, 32601
Debugger [baseline] (67.753 ms) : 0, 67753
Debugger [candidate] (68.364 ms) : 0, 68364
Remote Config [baseline] (679.037 µs) : 0, 679
Remote Config [candidate] (633.926 µs) : 0, 634
Telemetry [baseline] (9.071 ms) : 0, 9071
Telemetry [candidate] (8.893 ms) : 0, 8893
Flare Poller [baseline] (3.816 ms) : 0, 3816
Flare Poller [candidate] (3.848 ms) : 0, 3848
section appsec
crashtracking [baseline] (1.177 ms) : 0, 1177
crashtracking [candidate] (1.182 ms) : 0, 1182
BytebuddyAgent [baseline] (690.587 ms) : 0, 690587
BytebuddyAgent [candidate] (692.568 ms) : 0, 692568
GlobalTracer [baseline] (258.794 ms) : 0, 258794
GlobalTracer [candidate] (260.182 ms) : 0, 260182
AppSec [baseline] (173.427 ms) : 0, 173427
AppSec [candidate] (172.464 ms) : 0, 172464
Debugger [baseline] (66.111 ms) : 0, 66111
Debugger [candidate] (69.031 ms) : 0, 69031
Remote Config [baseline] (744.647 µs) : 0, 745
Remote Config [candidate] (805.037 µs) : 0, 805
Telemetry [baseline] (9.316 ms) : 0, 9316
Telemetry [candidate] (9.308 ms) : 0, 9308
Flare Poller [baseline] (3.74 ms) : 0, 3740
Flare Poller [candidate] (3.721 ms) : 0, 3721
IAST [baseline] (24.516 ms) : 0, 24516
IAST [candidate] (24.481 ms) : 0, 24481
section iast
crashtracking [baseline] (1.182 ms) : 0, 1182
crashtracking [candidate] (1.185 ms) : 0, 1185
BytebuddyAgent [baseline] (793.882 ms) : 0, 793882
BytebuddyAgent [candidate] (795.595 ms) : 0, 795595
GlobalTracer [baseline] (256.818 ms) : 0, 256818
GlobalTracer [candidate] (257.065 ms) : 0, 257065
AppSec [baseline] (34.58 ms) : 0, 34580
AppSec [candidate] (35.132 ms) : 0, 35132
Debugger [baseline] (65.844 ms) : 0, 65844
Debugger [candidate] (64.733 ms) : 0, 64733
Remote Config [baseline] (574.051 µs) : 0, 574
Remote Config [candidate] (605.438 µs) : 0, 605
Telemetry [baseline] (8.505 ms) : 0, 8505
Telemetry [candidate] (8.488 ms) : 0, 8488
Flare Poller [baseline] (3.651 ms) : 0, 3651
Flare Poller [candidate] (3.524 ms) : 0, 3524
IAST [baseline] (27.005 ms) : 0, 27005
IAST [candidate] (26.948 ms) : 0, 26948
section profiling
ProfilingAgent [baseline] (98.621 ms) : 0, 98621
ProfilingAgent [candidate] (96.64 ms) : 0, 96640
crashtracking [baseline] (1.23 ms) : 0, 1230
crashtracking [candidate] (1.222 ms) : 0, 1222
BytebuddyAgent [baseline] (707.12 ms) : 0, 707120
BytebuddyAgent [candidate] (705.664 ms) : 0, 705664
GlobalTracer [baseline] (222.67 ms) : 0, 222670
GlobalTracer [candidate] (222.21 ms) : 0, 222210
AppSec [baseline] (32.681 ms) : 0, 32681
AppSec [candidate] (32.483 ms) : 0, 32483
Debugger [baseline] (69.297 ms) : 0, 69297
Debugger [candidate] (68.005 ms) : 0, 68005
Remote Config [baseline] (674.672 µs) : 0, 675
Remote Config [candidate] (681.335 µs) : 0, 681
Telemetry [baseline] (9.092 ms) : 0, 9092
Telemetry [candidate] (8.983 ms) : 0, 8983
Flare Poller [baseline] (4.541 ms) : 0, 4541
Flare Poller [candidate] (3.731 ms) : 0, 3731
Profiling [baseline] (99.21 ms) : 0, 99210
Profiling [candidate] (97.214 ms) : 0, 97214
Loading
Startup time reports for insecure-bank
gantt
    title insecure-bank - global startup overhead: candidate=1.57.0-SNAPSHOT~f8d77fd44e, baseline=1.59.0-SNAPSHOT~c91ab36874

    dateFormat X
    axisFormat %s
section tracing
Agent [baseline] (1.085 s) : 0, 1084824
Total [baseline] (8.768 s) : 0, 8768170
Agent [candidate] (1.094 s) : 0, 1093647
Total [candidate] (8.751 s) : 0, 8751103
section iast
Agent [baseline] (1.232 s) : 0, 1231768
Total [baseline] (9.345 s) : 0, 9344899
Agent [candidate] (1.225 s) : 0, 1225437
Total [candidate] (9.431 s) : 0, 9431375
Loading
  • baseline results
Module Variant Duration Δ tracing
Agent tracing 1.085 s -
Agent iast 1.232 s 146.944 ms (13.5%)
Total tracing 8.768 s -
Total iast 9.345 s 576.729 ms (6.6%)
  • candidate results
Module Variant Duration Δ tracing
Agent tracing 1.094 s -
Agent iast 1.225 s 131.789 ms (12.1%)
Total tracing 8.751 s -
Total iast 9.431 s 680.272 ms (7.8%)
gantt
    title insecure-bank - break down per module: candidate=1.57.0-SNAPSHOT~f8d77fd44e, baseline=1.59.0-SNAPSHOT~c91ab36874

    dateFormat X
    axisFormat %s
section tracing
crashtracking [baseline] (1.182 ms) : 0, 1182
crashtracking [candidate] (1.199 ms) : 0, 1199
BytebuddyAgent [baseline] (652.385 ms) : 0, 652385
BytebuddyAgent [candidate] (656.767 ms) : 0, 656767
GlobalTracer [baseline] (283.017 ms) : 0, 283017
GlobalTracer [candidate] (285.451 ms) : 0, 285451
AppSec [baseline] (32.458 ms) : 0, 32458
AppSec [candidate] (33.041 ms) : 0, 33041
Debugger [baseline] (66.836 ms) : 0, 66836
Debugger [candidate] (66.497 ms) : 0, 66497
Remote Config [baseline] (636.435 µs) : 0, 636
Remote Config [candidate] (632.56 µs) : 0, 633
Telemetry [baseline] (8.914 ms) : 0, 8914
Telemetry [candidate] (8.912 ms) : 0, 8912
Flare Poller [baseline] (3.768 ms) : 0, 3768
Flare Poller [candidate] (5.457 ms) : 0, 5457
section iast
crashtracking [baseline] (1.199 ms) : 0, 1199
crashtracking [candidate] (1.176 ms) : 0, 1176
BytebuddyAgent [baseline] (799.222 ms) : 0, 799222
BytebuddyAgent [candidate] (792.35 ms) : 0, 792350
GlobalTracer [baseline] (256.566 ms) : 0, 256566
GlobalTracer [candidate] (256.855 ms) : 0, 256855
IAST [baseline] (27.016 ms) : 0, 27016
IAST [candidate] (26.931 ms) : 0, 26931
AppSec [baseline] (34.592 ms) : 0, 34592
AppSec [candidate] (34.286 ms) : 0, 34286
Debugger [baseline] (64.685 ms) : 0, 64685
Debugger [candidate] (65.634 ms) : 0, 65634
Remote Config [baseline] (583.27 µs) : 0, 583
Remote Config [candidate] (587.938 µs) : 0, 588
Telemetry [baseline] (8.533 ms) : 0, 8533
Telemetry [candidate] (8.592 ms) : 0, 8592
Flare Poller [baseline] (3.66 ms) : 0, 3660
Flare Poller [candidate] (3.645 ms) : 0, 3645
Loading

Load

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
git_branch master andrea.marziali/remove-jctools-queues
git_commit_date 1769006261 1769083203
git_commit_sha c91ab36 f8d77fd
release_version 1.59.0-SNAPSHOT~c91ab36874 1.57.0-SNAPSHOT~f8d77fd44e
See matching parameters
Baseline Candidate
application insecure-bank insecure-bank
ci_job_date 1769085681 1769085681
ci_job_id 1369554908 1369554908
ci_pipeline_id 92240027 92240027
cpu_model Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz
kernel_version Linux runner-zfyrx7zua-project-304-concurrent-0-1naulbx6 6.8.0-1031-aws #33~22.04.1-Ubuntu SMP Thu Jun 26 14:22:30 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux Linux runner-zfyrx7zua-project-304-concurrent-0-1naulbx6 6.8.0-1031-aws #33~22.04.1-Ubuntu SMP Thu Jun 26 14:22:30 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux

Summary

Found 2 performance improvements and 1 performance regressions! Performance is the same for 13 metrics, 20 unstable metrics.

scenario Δ mean agg_http_req_duration_p50 Δ mean agg_http_req_duration_p95 Δ mean throughput candidate mean agg_http_req_duration_p50 candidate mean agg_http_req_duration_p95 candidate mean throughput baseline mean agg_http_req_duration_p50 baseline mean agg_http_req_duration_p95 baseline mean throughput
scenario:load:insecure-bank:iast_FULL:high_load better
[-486.610µs; -117.393µs] or [-9.214%; -2.223%]
unstable
[-1.840ms; -0.435ms] or [-14.105%; -3.334%]
unstable
[-45.066op/s; +135.066op/s] or [-5.859%; +17.559%]
4.979ms 11.906ms 814.219op/s 5.281ms 13.043ms 769.219op/s
scenario:load:petclinic:iast:high_load better
[-1.494ms; -0.688ms] or [-8.138%; -3.750%]
unsure
[-1640.879µs; -283.672µs] or [-5.595%; -0.967%]
unstable
[-12.002op/s; +39.814op/s] or [-4.784%; +15.870%]
17.267ms 28.364ms 264.781op/s 18.358ms 29.326ms 250.875op/s
scenario:load:petclinic:appsec:high_load worse
[+0.476ms; +1.538ms] or [+2.600%; +8.408%]
unsure
[+0.471ms; +2.048ms] or [+1.583%; +6.889%]
unstable
[-34.106op/s; +15.418op/s] or [-13.701%; +6.194%]
19.297ms 30.993ms 239.594op/s 18.290ms 29.733ms 248.938op/s
Request duration reports for insecure-bank
gantt
    title insecure-bank - request duration [CI 0.99] : candidate=1.57.0-SNAPSHOT~f8d77fd44e, baseline=1.59.0-SNAPSHOT~c91ab36874
    dateFormat X
    axisFormat %s
section baseline
no_agent (1.184 ms) : 1173, 1196
.   : milestone, 1184,
iast (3.158 ms) : 3117, 3198
.   : milestone, 3158,
iast_FULL (6.011 ms) : 5950, 6073
.   : milestone, 6011,
iast_GLOBAL (3.458 ms) : 3411, 3506
.   : milestone, 3458,
profiling (1.965 ms) : 1946, 1984
.   : milestone, 1965,
tracing (1.873 ms) : 1857, 1890
.   : milestone, 1873,
section candidate
no_agent (1.213 ms) : 1201, 1225
.   : milestone, 1213,
iast (3.091 ms) : 3051, 3130
.   : milestone, 3091,
iast_FULL (5.676 ms) : 5620, 5733
.   : milestone, 5676,
iast_GLOBAL (3.485 ms) : 3433, 3537
.   : milestone, 3485,
profiling (1.926 ms) : 1910, 1942
.   : milestone, 1926,
tracing (1.757 ms) : 1743, 1771
.   : milestone, 1757,
Loading
  • baseline results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 1.184 ms [1.173 ms, 1.196 ms] -
iast 3.158 ms [3.117 ms, 3.198 ms] 1.974 ms (166.7%)
iast_FULL 6.011 ms [5.95 ms, 6.073 ms] 4.827 ms (407.6%)
iast_GLOBAL 3.458 ms [3.411 ms, 3.506 ms] 2.274 ms (192.0%)
profiling 1.965 ms [1.946 ms, 1.984 ms] 780.282 µs (65.9%)
tracing 1.873 ms [1.857 ms, 1.89 ms] 689.103 µs (58.2%)
  • candidate results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 1.213 ms [1.201 ms, 1.225 ms] -
iast 3.091 ms [3.051 ms, 3.13 ms] 1.878 ms (154.8%)
iast_FULL 5.676 ms [5.62 ms, 5.733 ms] 4.463 ms (368.0%)
iast_GLOBAL 3.485 ms [3.433 ms, 3.537 ms] 2.272 ms (187.4%)
profiling 1.926 ms [1.91 ms, 1.942 ms] 712.77 µs (58.8%)
tracing 1.757 ms [1.743 ms, 1.771 ms] 544.26 µs (44.9%)
Request duration reports for petclinic
gantt
    title petclinic - request duration [CI 0.99] : candidate=1.57.0-SNAPSHOT~f8d77fd44e, baseline=1.59.0-SNAPSHOT~c91ab36874
    dateFormat X
    axisFormat %s
section baseline
no_agent (18.182 ms) : 17996, 18369
.   : milestone, 18182,
appsec (18.752 ms) : 18567, 18937
.   : milestone, 18752,
code_origins (17.911 ms) : 17730, 18092
.   : milestone, 17911,
iast (18.607 ms) : 18421, 18793
.   : milestone, 18607,
profiling (18.735 ms) : 18551, 18920
.   : milestone, 18735,
tracing (17.63 ms) : 17454, 17806
.   : milestone, 17630,
section candidate
no_agent (17.979 ms) : 17794, 18165
.   : milestone, 17979,
appsec (19.486 ms) : 19286, 19687
.   : milestone, 19486,
code_origins (17.608 ms) : 17433, 17782
.   : milestone, 17608,
iast (17.625 ms) : 17453, 17796
.   : milestone, 17625,
profiling (18.519 ms) : 18334, 18704
.   : milestone, 18519,
tracing (17.491 ms) : 17318, 17663
.   : milestone, 17491,
Loading
  • baseline results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 18.182 ms [17.996 ms, 18.369 ms] -
appsec 18.752 ms [18.567 ms, 18.937 ms] 569.738 µs (3.1%)
code_origins 17.911 ms [17.73 ms, 18.092 ms] -271.424 µs (-1.5%)
iast 18.607 ms [18.421 ms, 18.793 ms] 424.587 µs (2.3%)
profiling 18.735 ms [18.551 ms, 18.92 ms] 553.156 µs (3.0%)
tracing 17.63 ms [17.454 ms, 17.806 ms] -552.166 µs (-3.0%)
  • candidate results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 17.979 ms [17.794 ms, 18.165 ms] -
appsec 19.486 ms [19.286 ms, 19.687 ms] 1.507 ms (8.4%)
code_origins 17.608 ms [17.433 ms, 17.782 ms] -371.885 µs (-2.1%)
iast 17.625 ms [17.453 ms, 17.796 ms] -354.658 µs (-2.0%)
profiling 18.519 ms [18.334 ms, 18.704 ms] 539.536 µs (3.0%)
tracing 17.491 ms [17.318 ms, 17.663 ms] -488.914 µs (-2.7%)

Dacapo

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
git_branch master andrea.marziali/remove-jctools-queues
git_commit_date 1769006261 1769083203
git_commit_sha c91ab36 f8d77fd
release_version 1.59.0-SNAPSHOT~c91ab36874 1.57.0-SNAPSHOT~f8d77fd44e
See matching parameters
Baseline Candidate
application biojava biojava
ci_job_date 1769085439 1769085439
ci_job_id 1369554909 1369554909
ci_pipeline_id 92240027 92240027
cpu_model Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz
kernel_version Linux runner-zfyrx7zua-project-304-concurrent-1-vx9fnj8e 6.8.0-1031-aws #33~22.04.1-Ubuntu SMP Thu Jun 26 14:22:30 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux Linux runner-zfyrx7zua-project-304-concurrent-1-vx9fnj8e 6.8.0-1031-aws #33~22.04.1-Ubuntu SMP Thu Jun 26 14:22:30 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux

Summary

Found 0 performance improvements and 0 performance regressions! Performance is the same for 11 metrics, 1 unstable metrics.

Execution time for biojava
gantt
    title biojava - execution time [CI 0.99] : candidate=1.57.0-SNAPSHOT~f8d77fd44e, baseline=1.59.0-SNAPSHOT~c91ab36874
    dateFormat X
    axisFormat %s
section baseline
no_agent (14.983 s) : 14983000, 14983000
.   : milestone, 14983000,
appsec (14.487 s) : 14487000, 14487000
.   : milestone, 14487000,
iast (18.058 s) : 18058000, 18058000
.   : milestone, 18058000,
iast_GLOBAL (17.707 s) : 17707000, 17707000
.   : milestone, 17707000,
profiling (15.012 s) : 15012000, 15012000
.   : milestone, 15012000,
tracing (14.642 s) : 14642000, 14642000
.   : milestone, 14642000,
section candidate
no_agent (15.319 s) : 15319000, 15319000
.   : milestone, 15319000,
appsec (14.513 s) : 14513000, 14513000
.   : milestone, 14513000,
iast (18.046 s) : 18046000, 18046000
.   : milestone, 18046000,
iast_GLOBAL (17.953 s) : 17953000, 17953000
.   : milestone, 17953000,
profiling (15.342 s) : 15342000, 15342000
.   : milestone, 15342000,
tracing (14.669 s) : 14669000, 14669000
.   : milestone, 14669000,
Loading
  • baseline results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 14.983 s [14.983 s, 14.983 s] -
appsec 14.487 s [14.487 s, 14.487 s] -496.0 ms (-3.3%)
iast 18.058 s [18.058 s, 18.058 s] 3.075 s (20.5%)
iast_GLOBAL 17.707 s [17.707 s, 17.707 s] 2.724 s (18.2%)
profiling 15.012 s [15.012 s, 15.012 s] 29.0 ms (0.2%)
tracing 14.642 s [14.642 s, 14.642 s] -341.0 ms (-2.3%)
  • candidate results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 15.319 s [15.319 s, 15.319 s] -
appsec 14.513 s [14.513 s, 14.513 s] -806.0 ms (-5.3%)
iast 18.046 s [18.046 s, 18.046 s] 2.727 s (17.8%)
iast_GLOBAL 17.953 s [17.953 s, 17.953 s] 2.634 s (17.2%)
profiling 15.342 s [15.342 s, 15.342 s] 23.0 ms (0.2%)
tracing 14.669 s [14.669 s, 14.669 s] -650.0 ms (-4.2%)
Execution time for tomcat
gantt
    title tomcat - execution time [CI 0.99] : candidate=1.57.0-SNAPSHOT~f8d77fd44e, baseline=1.59.0-SNAPSHOT~c91ab36874
    dateFormat X
    axisFormat %s
section baseline
no_agent (1.477 ms) : 1466, 1488
.   : milestone, 1477,
appsec (3.678 ms) : 3462, 3894
.   : milestone, 3678,
iast (2.229 ms) : 2164, 2295
.   : milestone, 2229,
iast_GLOBAL (2.259 ms) : 2194, 2325
.   : milestone, 2259,
profiling (2.081 ms) : 2027, 2136
.   : milestone, 2081,
tracing (2.046 ms) : 1995, 2098
.   : milestone, 2046,
section candidate
no_agent (1.478 ms) : 1467, 1490
.   : milestone, 1478,
appsec (3.725 ms) : 3504, 3947
.   : milestone, 3725,
iast (2.231 ms) : 2165, 2296
.   : milestone, 2231,
iast_GLOBAL (2.267 ms) : 2201, 2332
.   : milestone, 2267,
profiling (2.084 ms) : 2029, 2139
.   : milestone, 2084,
tracing (2.06 ms) : 2008, 2112
.   : milestone, 2060,
Loading
  • baseline results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 1.477 ms [1.466 ms, 1.488 ms] -
appsec 3.678 ms [3.462 ms, 3.894 ms] 2.201 ms (149.0%)
iast 2.229 ms [2.164 ms, 2.295 ms] 752.019 µs (50.9%)
iast_GLOBAL 2.259 ms [2.194 ms, 2.325 ms] 782.342 µs (53.0%)
profiling 2.081 ms [2.027 ms, 2.136 ms] 604.402 µs (40.9%)
tracing 2.046 ms [1.995 ms, 2.098 ms] 569.373 µs (38.5%)
  • candidate results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 1.478 ms [1.467 ms, 1.49 ms] -
appsec 3.725 ms [3.504 ms, 3.947 ms] 2.247 ms (152.0%)
iast 2.231 ms [2.165 ms, 2.296 ms] 752.564 µs (50.9%)
iast_GLOBAL 2.267 ms [2.201 ms, 2.332 ms] 788.508 µs (53.3%)
profiling 2.084 ms [2.029 ms, 2.139 ms] 605.921 µs (41.0%)
tracing 2.06 ms [2.008 ms, 2.112 ms] 581.546 µs (39.3%)

@amarziali amarziali force-pushed the andrea.marziali/remove-jctools-queues branch 6 times, most recently from 229f67a to 374d13d Compare November 7, 2025 14:59
@amarziali amarziali changed the title Removes jctools usage for lock-free queues. Replace JCTools queues with VarHandle-based implementations for Java 9+ Nov 10, 2025
@amarziali amarziali force-pushed the andrea.marziali/remove-jctools-queues branch 2 times, most recently from 21e0a65 to 259eeb5 Compare November 10, 2025 15:25
@amarziali amarziali marked this pull request as ready for review November 10, 2025 16:20
@amarziali amarziali requested review from a team as code owners November 10, 2025 16:20
@amarziali amarziali requested a review from mcculls November 10, 2025 16:20
@github-actions
Copy link
Contributor

Hi! 👋 Thanks for your pull request! 🎉

To help us review it, please make sure to:

  • Add at least one type, and one component or instrumentation label to the pull request

If you need help, please check our contributing guidelines.

@amarziali amarziali requested a review from dougqh November 10, 2025 16:20
@amarziali amarziali added type: enhancement Enhancements and improvements comp: core Tracer core labels Nov 10, 2025
@amarziali amarziali force-pushed the andrea.marziali/remove-jctools-queues branch from 9e7acbe to b2850b3 Compare November 12, 2025 09:01
@franz1981
Copy link

Hi @amarziali I am one of the developers of JCTools and we are super happy if we could bring a var handle generation variant in our lib as well.
I can see the value and faster feedback/different ownership of having a stripped version of our dependency (which can still be obtain via shading actually...), but I believe would be a great community value if we could join efforts...plus, we love contributions ☺️

Note: JCTools is at the very core of other frameworks which will soon hit the "no unsafe world" JVM barrier, including Netty.
I'm recently working hard to improve it re this aspect, and JCtools is one of the key but missing pieces there too.
Which means that contributing to JCTools would bring an enormous value to Netty and to many others very impactful projects as well
🙏

@amarziali amarziali force-pushed the andrea.marziali/remove-jctools-queues branch 3 times, most recently from 85b0dcd to fc49419 Compare November 17, 2025 12:28
@amarziali amarziali force-pushed the andrea.marziali/remove-jctools-queues branch from fc49419 to 183fc37 Compare November 19, 2025 17:27
amarziali and others added 7 commits January 21, 2026 17:05
Co-authored-by: Stuart McCulloch <stuart.mcculloch@datadoghq.com>
Co-authored-by: Stuart McCulloch <stuart.mcculloch@datadoghq.com>
….java

Co-authored-by: Stuart McCulloch <stuart.mcculloch@datadoghq.com>
@amarziali amarziali requested a review from mcculls January 21, 2026 17:10
Copy link
Contributor

@mcculls mcculls left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work!

@amarziali amarziali changed the title Replace JCTools queues with VarHandle-based implementations for Java 9+ Replace JCTools queues with VarHandle-based implementations for Java 25+ Jan 22, 2026
@amarziali amarziali enabled auto-merge (squash) January 22, 2026 12:05
@amarziali amarziali merged commit 3d62379 into master Jan 22, 2026
571 of 572 checks passed
@amarziali amarziali deleted the andrea.marziali/remove-jctools-queues branch January 22, 2026 12:54
@github-actions github-actions bot added this to the 1.59.0 milestone Jan 22, 2026
@bric3
Copy link
Contributor

bric3 commented Jan 23, 2026

Bravo @amarziali

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp: core Tracer core type: enhancement Enhancements and improvements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants