Skip to content

Commit bb784c0

Browse files
dougqhclaude
andcommitted
Add VarHandle note to AtomicsBenchmark Javadoc
VarHandle (Java 9+) is the modern replacement for AtomicIntegerFieldUpdater and would likely close the incrementAndGet performance gap. Not usable here because internal-api targets Java 8. Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
1 parent 7f56a97 commit bb784c0

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

internal-api/src/jmh/java/datadog/trace/util/AtomicsBenchmark.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@
2727
*
2828
* AtomicFieldUpdater supports {@code int}, {@code long}, and reference types.
2929
*
30+
* <p><b>Future:</b> {@code VarHandle} (Java 9+) is the modern replacement for
31+
* AtomicIntegerFieldUpdater. It avoids the reflective field-access overhead, which should close
32+
* the incrementAndGet gap with AtomicInteger while retaining the construction allocation advantage.
33+
* Not available here because internal-api targets Java 8.
34+
*
3035
* <code> Java 17 - MacBook M1 - 8 threads
3136
* Benchmark Mode Cnt Score Error Units
3237
* AtomicsBenchmark.atomicFieldUpdater_construction thrpt 6 2215272588.708 ± 88556141.052 ops/s

0 commit comments

Comments
 (0)