Skip to content

Instantly share code, notes, and snippets.

@franz1981
Created July 19, 2023 16:26
Show Gist options
  • Save franz1981/f40d3e7b70fb881d401b63103dbd6c98 to your computer and use it in GitHub Desktop.
Save franz1981/f40d3e7b70fb881d401b63103dbd6c98 to your computer and use it in GitHub Desktop.
package red.hat.puzzles.concurrent;
import org.openjdk.jmh.annotations.*;
import org.openjdk.jmh.infra.Blackhole;
import java.lang.invoke.MethodHandles;
import java.lang.invoke.VarHandle;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicLongFieldUpdater;
@State(Scope.Benchmark)
@Warmup(iterations = 10, time = 400, timeUnit = TimeUnit.MILLISECONDS)
@Measurement(iterations = 5, time = 200, timeUnit = TimeUnit.MILLISECONDS)
@OutputTimeUnit(TimeUnit.NANOSECONDS)
@BenchmarkMode(Mode.AverageTime)
@Fork(jvmArgs = "-XX:LoopUnrollLimit=1", value = 2)
public class StoreOps {
private static final AtomicLongFieldUpdater<StoreOps> VALUE_UPDATER = AtomicLongFieldUpdater.newUpdater(StoreOps.class, "updValue");
private static final VarHandle VALUE_HANDLE;
static {
try {
VALUE_HANDLE = MethodHandles.lookup().findVarHandle(StoreOps.class, "value", long.class);
} catch (ReflectiveOperationException e) {
throw new ExceptionInInitializerError(e);
}
}
// using int on purpose here
private static final int VALUE = 13;
private long value;
private volatile long updValue;
@Benchmark
public void updaterSetRelease() {
VALUE_UPDATER.lazySet(this, VALUE);
}
@Benchmark
public void vhSetRelease() {
VALUE_HANDLE.setRelease(this, VALUE);
}
}
@franz1981
Copy link
Author

perfasm output:

# JMH version: 1.34
# VM version: JDK 20.0.1, Java HotSpot(TM) 64-Bit Server VM, 20.0.1+9-29
# VM invoker: /home/forked_franz/.sdkman/candidates/java/20.0.1-oracle/bin/java
# VM options: -XX:LoopUnrollLimit=1
# Blackhole mode: compiler (auto-detected, use -Djmh.blackhole.autoDetect=false to disable)
# Warmup: 10 iterations, 400 ms each
# Measurement: 5 iterations, 200 ms each
# Timeout: 10 min per iteration
# Threads: 1 thread, will synchronize iterations
# Benchmark mode: Average time, time/op
# Benchmark: red.hat.puzzles.concurrent.StoreOps.updaterSetRelease

# Run progress: 0.00% complete, ETA 00:00:20
# Fork: 1 of 2
# Preparing profilers: LinuxPerfAsmProfiler 
# Profilers consume stdout and stderr from target VM, use -v EXTRA to copy to console
# Warmup Iteration   1: 0.369 ns/op
# Warmup Iteration   2: 0.449 ns/op
# Warmup Iteration   3: 0.357 ns/op
# Warmup Iteration   4: 0.350 ns/op
# Warmup Iteration   5: 0.351 ns/op
# Warmup Iteration   6: 0.350 ns/op
# Warmup Iteration   7: 0.350 ns/op
# Warmup Iteration   8: 0.350 ns/op
# Warmup Iteration   9: 0.350 ns/op
# Warmup Iteration  10: 0.350 ns/op
Iteration   1: 0.350 ns/op
Iteration   2: 0.350 ns/op
Iteration   3: 0.350 ns/op
Iteration   4: 0.364 ns/op
Iteration   5: 0.350 ns/op
# Processing profiler results: LinuxPerfAsmProfiler 

# Run progress: 25.00% complete, ETA 00:00:23
# Fork: 2 of 2
# Preparing profilers: LinuxPerfAsmProfiler 
# Profilers consume stdout and stderr from target VM, use -v EXTRA to copy to console
# Warmup Iteration   1: 0.359 ns/op
# Warmup Iteration   2: 0.350 ns/op
# Warmup Iteration   3: 0.362 ns/op
# Warmup Iteration   4: 0.357 ns/op
# Warmup Iteration   5: 0.350 ns/op
# Warmup Iteration   6: 0.351 ns/op
# Warmup Iteration   7: 0.350 ns/op
# Warmup Iteration   8: 0.350 ns/op
# Warmup Iteration   9: 0.350 ns/op
# Warmup Iteration  10: 0.352 ns/op
Iteration   1: 0.350 ns/op
Iteration   2: 0.350 ns/op
Iteration   3: 0.355 ns/op
Iteration   4: 0.351 ns/op
Iteration   5: 0.350 ns/op
# Processing profiler results: LinuxPerfAsmProfiler 


Result "red.hat.puzzles.concurrent.StoreOps.updaterSetRelease":
  0.352 ±(99.9%) 0.007 ns/op [Average]
  (min, avg, max) = (0.350, 0.352, 0.364), stdev = 0.004
  CI (99.9%): [0.345, 0.359] (assumes normal distribution)

Secondary result "red.hat.puzzles.concurrent.StoreOps.updaterSetRelease:·asm":
PrintAssembly processed: 181613 total address lines.
Perf output processed (skipped 5.369 seconds):
 Column 1: cycles (844 events)

Hottest code regions (>10.00% "cycles" events):

....[Hottest Region 1]..............................................................................
c2, level 4, red.hat.puzzles.concurrent.jmh_generated.StoreOps_updaterSetRelease_jmhTest::updaterSetRelease_avgt_jmhStub, version 750 (25 bytes) 

                                                                       ; - red.hat.puzzles.concurrent.jmh_generated.StoreOps_updaterSetRelease_jmhTest::updaterSetRelease_avgt_jmhStub@25 (line 192)
             0x00007ffa8ca20f52:   mov    $0x1,%ebp
             0x00007ffa8ca20f57:   test   %r10d,%r10d
0x00007ffa8ca20f5a:   jne    0x00007ffa8ca20f83           ;*ifeq {reexecute=0 rethrow=0 return_oop=0}
                                                             ; - red.hat.puzzles.concurrent.jmh_generated.StoreOps_updaterSetRelease_jmhTest::updaterSetRelease_avgt_jmhStub@28 (line 192)
0x00007ffa8ca20f5c:   nopl   0x0(%rax)
         │↗  0x00007ffa8ca20f60:   movq   $0xd,0x18(%r8)               ;*invokevirtual putLongRelease {reexecute=0 rethrow=0 return_oop=0}
         ││                                                            ; - java.util.concurrent.atomic.AtomicLongFieldUpdater$CASUpdater::lazySet@14 (line 479)
         ││                                                            ; - red.hat.puzzles.concurrent.StoreOps::updaterSetRelease@7 (line 38)
         ││                                                            ; - red.hat.puzzles.concurrent.jmh_generated.StoreOps_updaterSetRelease_jmhTest::updaterSetRelease_avgt_jmhStub@15 (line 190)
  0.47%  ││  0x00007ffa8ca20f68:   movzbl 0x94(%r9),%r10d              ;*getfield isDone {reexecute=0 rethrow=0 return_oop=0}
         ││                                                            ; - red.hat.puzzles.concurrent.jmh_generated.StoreOps_updaterSetRelease_jmhTest::updaterSetRelease_avgt_jmhStub@25 (line 192)
         ││  0x00007ffa8ca20f70:   mov    0x380(%r15),%r11
  0.71%  ││  0x00007ffa8ca20f77:   add    $0x1,%rbp                    ; ImmutableOopMap {r8=Oop r9=Oop rbx=Oop }
         ││                                                            ;*ifeq {reexecute=1 rethrow=0 return_oop=0}
         ││                                                            ; - (reexecute) red.hat.puzzles.concurrent.jmh_generated.StoreOps_updaterSetRelease_jmhTest::updaterSetRelease_avgt_jmhStub@28 (line 192)
         ││  0x00007ffa8ca20f7b:   test   %eax,(%r11)                  ;   {poll}
 92.06%  ││  0x00007ffa8ca20f7e:   test   %r10d,%r10d
  0.12%  │╰  0x00007ffa8ca20f81:   je     0x00007ffa8ca20f60           ;*aload_1 {reexecute=0 rethrow=0 return_oop=0}
                                                             ; - red.hat.puzzles.concurrent.jmh_generated.StoreOps_updaterSetRelease_jmhTest::updaterSetRelease_avgt_jmhStub@31 (line 193)
0x00007ffa8ca20f83:   movabs $0x7ffaa4493b90,%r10
             0x00007ffa8ca20f8d:   call   *%r10                        ;*invokestatic nanoTime {reexecute=0 rethrow=0 return_oop=0}
                                                                       ; - red.hat.puzzles.concurrent.jmh_generated.StoreOps_updaterSetRelease_jmhTest::updaterSetRelease_avgt_jmhStub@32 (line 193)
             0x00007ffa8ca20f90:   mov    %rax,0x30(%rbx)              ;*putfield stopTime {reexecute=0 rethrow=0 return_oop=0}
                                                                       ; - red.hat.puzzles.concurrent.jmh_generated.StoreOps_updaterSetRelease_jmhTest::updaterSetRelease_avgt_jmhStub@35 (line 193)
             0x00007ffa8ca20f94:   mov    %r12,0x20(%rbx)              ;*putfield realTime {reexecute=0 rethrow=0 return_oop=0}
                                                                       ; - red.hat.puzzles.concurrent.jmh_generated.StoreOps_updaterSetRelease_jmhTest::updaterSetRelease_avgt_jmhStub@41 (line 194)
             0x00007ffa8ca20f98:   vcvtsi2sd %rbp,%xmm0,%xmm0
             0x00007ffa8ca20f9d:   vmovsd %xmm0,0x18(%rbx)
....................................................................................................
 93.36%  <total for region 1>

....[Hottest Regions]...............................................................................
 93.36%         c2, level 4  red.hat.puzzles.concurrent.jmh_generated.StoreOps_updaterSetRelease_jmhTest::updaterSetRelease_avgt_jmhStub, version 750 (25 bytes) 
  1.54%   [kernel.kallsyms]  finish_task_switch.isra.0 (43 bytes) 
  0.95%   [kernel.kallsyms]  _raw_spin_unlock (2 bytes) 
  0.47%                      <unknown> (0 bytes) 
  0.36%   [kernel.kallsyms]  _raw_spin_lock_irq (0 bytes) 
  0.24%   [kernel.kallsyms]  selinux_file_permission (30 bytes) 
  0.12%   [kernel.kallsyms]  get_signal (0 bytes) 
  0.12%   [kernel.kallsyms]  futex_wait_queue (0 bytes) 
  0.12%   [kernel.kallsyms]  bpf_lsm_file_permission (0 bytes) 
  0.12%   [kernel.kallsyms]  shmem_get_folio_gfp (0 bytes) 
  0.12%   [kernel.kallsyms]  __count_memcg_events (0 bytes) 
  0.12%   [kernel.kallsyms]  vfs_write (0 bytes) 
  0.12%   [kernel.kallsyms]  avc_has_perm_noaudit (0 bytes) 
  0.12%   [kernel.kallsyms]  copy_user_enhanced_fast_string (0 bytes) 
  0.12%   [kernel.kallsyms]  native_sched_clock (0 bytes) 
  0.12%   [kernel.kallsyms]  mutex_unlock (0 bytes) 
  0.12%   [kernel.kallsyms]  mutex_lock (0 bytes) 
  0.12%   [kernel.kallsyms]  down_write (0 bytes) 
  0.12%   [kernel.kallsyms]  syscall_return_via_sysret (0 bytes) 
  0.12%         c1, level 3  java.lang.String::concat, version 515 (0 bytes) 
  1.30%  <...other 11 warm regions...>
....................................................................................................
 99.88%  <totals>

....[Hottest Methods (after inlining)]..............................................................
 93.36%         c2, level 4  red.hat.puzzles.concurrent.jmh_generated.StoreOps_updaterSetRelease_jmhTest::updaterSetRelease_avgt_jmhStub, version 750 
  1.54%   [kernel.kallsyms]  finish_task_switch.isra.0 
  0.95%   [kernel.kallsyms]  _raw_spin_unlock 
  0.47%                      <unknown> 
  0.36%   [kernel.kallsyms]  _raw_spin_lock_irq 
  0.24%   [kernel.kallsyms]  selinux_file_permission 
  0.12%           libjvm.so  LinearScan::add_def 
  0.12%         interpreter  ifne  154 ifne  
  0.12%           libc.so.6  _IO_fflush 
  0.12%   [kernel.kallsyms]  futex_wait_queue 
  0.12%           libjvm.so  fileStream::write 
  0.12%           libc.so.6  _IO_fwrite 
  0.12%         c1, level 3  java.lang.String::concat, version 515 
  0.12%   [kernel.kallsyms]  copy_user_enhanced_fast_string 
  0.12%           libc.so.6  __printf_buffer_write 
  0.12%   [kernel.kallsyms]  syscall_return_via_sysret 
  0.12%           libc.so.6  __ctype_init 
  0.12%   [kernel.kallsyms]  native_sched_clock 
  0.12%   [kernel.kallsyms]  down_write 
  0.12%           libjvm.so  InstanceKlass::uncached_lookup_method 
  1.30%  <...other 11 warm methods...>
....................................................................................................
 99.88%  <totals>

....[Distribution by Source]........................................................................
 93.36%         c2, level 4
  4.62%   [kernel.kallsyms]
  0.59%           libjvm.so
  0.47%                    
  0.47%           libc.so.6
  0.24%         interpreter
  0.12%         c1, level 3
....................................................................................................
 99.88%  <totals>

WARNING: The perf event count is suspiciously low (844). The performance data might be
inaccurate or misleading. Try to do the profiling again, or tune up the sampling frequency.
With some profilers on Mac OS X, System Integrity Protection (SIP) may prevent profiling.
In such case, temporarily disabling SIP with 'csrutil disable' might help.
PrintAssembly processed: 180827 total address lines.
Perf output processed (skipped 5.343 seconds):
 Column 1: cycles (827 events)

Hottest code regions (>10.00% "cycles" events):

....[Hottest Region 1]..............................................................................
c2, level 4, red.hat.puzzles.concurrent.jmh_generated.StoreOps_updaterSetRelease_jmhTest::updaterSetRelease_avgt_jmhStub, version 745 (22 bytes) 

                                                                       ; - red.hat.puzzles.concurrent.jmh_generated.StoreOps_updaterSetRelease_jmhTest::updaterSetRelease_avgt_jmhStub@25 (line 192)
             0x00007f9524a21bd2:   mov    $0x1,%ebp
             0x00007f9524a21bd7:   test   %r10d,%r10d
0x00007f9524a21bda:   jne    0x00007f9524a21c03           ;*ifeq {reexecute=0 rethrow=0 return_oop=0}
                                                             ; - red.hat.puzzles.concurrent.jmh_generated.StoreOps_updaterSetRelease_jmhTest::updaterSetRelease_avgt_jmhStub@28 (line 192)
0x00007f9524a21bdc:   nopl   0x0(%rax)
         │↗  0x00007f9524a21be0:   movq   $0xd,0x18(%r8)               ;*invokevirtual putLongRelease {reexecute=0 rethrow=0 return_oop=0}
         ││                                                            ; - java.util.concurrent.atomic.AtomicLongFieldUpdater$CASUpdater::lazySet@14 (line 479)
         ││                                                            ; - red.hat.puzzles.concurrent.StoreOps::updaterSetRelease@7 (line 38)
         ││                                                            ; - red.hat.puzzles.concurrent.jmh_generated.StoreOps_updaterSetRelease_jmhTest::updaterSetRelease_avgt_jmhStub@15 (line 190)
  0.12%  ││  0x00007f9524a21be8:   movzbl 0x94(%r9),%r10d              ;*getfield isDone {reexecute=0 rethrow=0 return_oop=0}
         ││                                                            ; - red.hat.puzzles.concurrent.jmh_generated.StoreOps_updaterSetRelease_jmhTest::updaterSetRelease_avgt_jmhStub@25 (line 192)
         ││  0x00007f9524a21bf0:   mov    0x380(%r15),%r11
  0.48%  ││  0x00007f9524a21bf7:   add    $0x1,%rbp                    ; ImmutableOopMap {r8=Oop r9=Oop rbx=Oop }
         ││                                                            ;*ifeq {reexecute=1 rethrow=0 return_oop=0}
         ││                                                            ; - (reexecute) red.hat.puzzles.concurrent.jmh_generated.StoreOps_updaterSetRelease_jmhTest::updaterSetRelease_avgt_jmhStub@28 (line 192)
  0.24%  ││  0x00007f9524a21bfb:   test   %eax,(%r11)                  ;   {poll}
 91.78%  ││  0x00007f9524a21bfe:   test   %r10d,%r10d
         │╰  0x00007f9524a21c01:   je     0x00007f9524a21be0           ;*aload_1 {reexecute=0 rethrow=0 return_oop=0}
                                                             ; - red.hat.puzzles.concurrent.jmh_generated.StoreOps_updaterSetRelease_jmhTest::updaterSetRelease_avgt_jmhStub@31 (line 193)
0x00007f9524a21c03:   movabs $0x7f953b693b90,%r10
             0x00007f9524a21c0d:   call   *%r10                        ;*invokestatic nanoTime {reexecute=0 rethrow=0 return_oop=0}
                                                                       ; - red.hat.puzzles.concurrent.jmh_generated.StoreOps_updaterSetRelease_jmhTest::updaterSetRelease_avgt_jmhStub@32 (line 193)
             0x00007f9524a21c10:   mov    %rax,0x30(%rbx)              ;*putfield stopTime {reexecute=0 rethrow=0 return_oop=0}
                                                                       ; - red.hat.puzzles.concurrent.jmh_generated.StoreOps_updaterSetRelease_jmhTest::updaterSetRelease_avgt_jmhStub@35 (line 193)
             0x00007f9524a21c14:   mov    %r12,0x20(%rbx)              ;*putfield realTime {reexecute=0 rethrow=0 return_oop=0}
                                                                       ; - red.hat.puzzles.concurrent.jmh_generated.StoreOps_updaterSetRelease_jmhTest::updaterSetRelease_avgt_jmhStub@41 (line 194)
             0x00007f9524a21c18:   vcvtsi2sd %rbp,%xmm0,%xmm0
....................................................................................................
 92.62%  <total for region 1>

....[Hottest Regions]...............................................................................
 92.62%         c2, level 4  red.hat.puzzles.concurrent.jmh_generated.StoreOps_updaterSetRelease_jmhTest::updaterSetRelease_avgt_jmhStub, version 745 (22 bytes) 
  1.93%   [kernel.kallsyms]  finish_task_switch.isra.0 (0 bytes) 
  1.45%   [kernel.kallsyms]  _raw_spin_unlock (0 bytes) 
  0.60%   [kernel.kallsyms]  native_queued_spin_lock_slowpath (3 bytes) 
  0.48%   [kernel.kallsyms]  finish_task_switch.isra.0 (0 bytes) 
  0.48%                      <unknown> (0 bytes) 
  0.48%   [kernel.kallsyms]  __perf_event_task_sched_in (0 bytes) 
  0.48%   [kernel.kallsyms]  schedule (0 bytes) 
  0.12%   [kernel.kallsyms]  native_flush_tlb_one_user (0 bytes) 
  0.12%   [kernel.kallsyms]  get_signal (0 bytes) 
  0.12%   [kernel.kallsyms]  pmd_page_vaddr (0 bytes) 
  0.12%   [kernel.kallsyms]  current_time (0 bytes) 
  0.12%   [kernel.kallsyms]  __get_user_8 (0 bytes) 
  0.12%   [kernel.kallsyms]  mutex_lock (0 bytes) 
  0.12%   [kernel.kallsyms]  _raw_spin_lock (0 bytes) 
  0.12%           libjvm.so  LinkResolver::resolve_interface_method (0 bytes) 
  0.12%           libjvm.so  nmethod::reloc_string_for (0 bytes) 
  0.12%           libc.so.6  __ctype_init (0 bytes) 
  0.12%           libc.so.6  __condvar_dec_grefs (0 bytes) 
....................................................................................................
 99.88%  <totals>

....[Hottest Methods (after inlining)]..............................................................
 92.62%         c2, level 4  red.hat.puzzles.concurrent.jmh_generated.StoreOps_updaterSetRelease_jmhTest::updaterSetRelease_avgt_jmhStub, version 745 
  2.42%   [kernel.kallsyms]  finish_task_switch.isra.0 
  1.45%   [kernel.kallsyms]  _raw_spin_unlock 
  0.60%   [kernel.kallsyms]  native_queued_spin_lock_slowpath 
  0.48%   [kernel.kallsyms]  __perf_event_task_sched_in 
  0.48%   [kernel.kallsyms]  schedule 
  0.48%                      <unknown> 
  0.12%   [kernel.kallsyms]  mutex_lock 
  0.12%           libjvm.so  nmethod::reloc_string_for 
  0.12%   [kernel.kallsyms]  pmd_page_vaddr 
  0.12%           libc.so.6  __condvar_dec_grefs 
  0.12%   [kernel.kallsyms]  __get_user_8 
  0.12%   [kernel.kallsyms]  _raw_spin_lock 
  0.12%           libc.so.6  __ctype_init 
  0.12%           libjvm.so  LinkResolver::resolve_interface_method 
  0.12%   [kernel.kallsyms]  native_flush_tlb_one_user 
  0.12%   [kernel.kallsyms]  get_signal 
  0.12%   [kernel.kallsyms]  current_time 
....................................................................................................
 99.88%  <totals>

....[Distribution by Source]........................................................................
 92.62%         c2, level 4
  6.29%   [kernel.kallsyms]
  0.48%                    
  0.24%           libjvm.so
  0.24%           libc.so.6
....................................................................................................
 99.88%  <totals>

WARNING: The perf event count is suspiciously low (827). The performance data might be
inaccurate or misleading. Try to do the profiling again, or tune up the sampling frequency.
With some profilers on Mac OS X, System Integrity Protection (SIP) may prevent profiling.
In such case, temporarily disabling SIP with 'csrutil disable' might help.


# JMH version: 1.34
# VM version: JDK 20.0.1, Java HotSpot(TM) 64-Bit Server VM, 20.0.1+9-29
# VM invoker: /home/forked_franz/.sdkman/candidates/java/20.0.1-oracle/bin/java
# VM options: -XX:LoopUnrollLimit=1
# Blackhole mode: compiler (auto-detected, use -Djmh.blackhole.autoDetect=false to disable)
# Warmup: 10 iterations, 400 ms each
# Measurement: 5 iterations, 200 ms each
# Timeout: 10 min per iteration
# Threads: 1 thread, will synchronize iterations
# Benchmark mode: Average time, time/op
# Benchmark: red.hat.puzzles.concurrent.StoreOps.vhSetRelease

# Run progress: 50.00% complete, ETA 00:00:15
# Fork: 1 of 2
# Preparing profilers: LinuxPerfAsmProfiler 
# Profilers consume stdout and stderr from target VM, use -v EXTRA to copy to console
# Warmup Iteration   1: 10.549 ns/op
# Warmup Iteration   2: 8.700 ns/op
# Warmup Iteration   3: 8.967 ns/op
# Warmup Iteration   4: 8.634 ns/op
# Warmup Iteration   5: 8.620 ns/op
# Warmup Iteration   6: 8.629 ns/op
# Warmup Iteration   7: 8.621 ns/op
# Warmup Iteration   8: 8.619 ns/op
# Warmup Iteration   9: 8.630 ns/op
# Warmup Iteration  10: 8.629 ns/op
Iteration   1: 8.627 ns/op
Iteration   2: 8.630 ns/op
Iteration   3: 8.631 ns/op
Iteration   4: 8.637 ns/op
Iteration   5: 8.660 ns/op
# Processing profiler results: LinuxPerfAsmProfiler 

# Run progress: 75.00% complete, ETA 00:00:07
# Fork: 2 of 2
# Preparing profilers: LinuxPerfAsmProfiler 
# Profilers consume stdout and stderr from target VM, use -v EXTRA to copy to console
# Warmup Iteration   1: 9.879 ns/op
# Warmup Iteration   2: 8.592 ns/op
# Warmup Iteration   3: 8.842 ns/op
# Warmup Iteration   4: 8.616 ns/op
# Warmup Iteration   5: 8.617 ns/op
# Warmup Iteration   6: 8.620 ns/op
# Warmup Iteration   7: 8.625 ns/op
# Warmup Iteration   8: 8.619 ns/op
# Warmup Iteration   9: 8.620 ns/op
# Warmup Iteration  10: 8.626 ns/op
Iteration   1: 8.619 ns/op
Iteration   2: 8.620 ns/op
Iteration   3: 8.625 ns/op
Iteration   4: 8.629 ns/op
Iteration   5: 8.630 ns/op
# Processing profiler results: LinuxPerfAsmProfiler 


Result "red.hat.puzzles.concurrent.StoreOps.vhSetRelease":
  8.631 ±(99.9%) 0.017 ns/op [Average]
  (min, avg, max) = (8.619, 8.631, 8.660), stdev = 0.011
  CI (99.9%): [8.613, 8.648] (assumes normal distribution)

Secondary result "red.hat.puzzles.concurrent.StoreOps.vhSetRelease:·asm":
PrintAssembly processed: 188761 total address lines.
Perf output processed (skipped 5.362 seconds):
 Column 1: cycles (846 events)

Hottest code regions (>10.00% "cycles" events):

....[Hottest Region 1]..............................................................................
c2, level 4, java.lang.invoke.LambdaForm$DMH.0x000000080102c400::invokeStatic, version 758 (69 bytes) 

           nul chk table  [0x00007f13e0a22cd8,0x00007f13e0a22ce8] = 16
          [Disassembly]
          --------------------------------------------------------------------------------
          [Constant Pool (empty)]
          --------------------------------------------------------------------------------
          [Verified Entry Point]
            # {method} {0x00007f13a84d9a98} &apos;invokeStatic&apos; &apos;(Ljava/lang/Object;I)J&apos; in &apos;java/lang/invoke/LambdaForm$DMH+0x000000080102c400&apos;
            # parm0:    rsi:rsi   = &apos;java/lang/Object&apos;
            # parm1:    rdx       = int
            #           [sp+0x30]  (sp of caller)
 10.40%     0x00007f13e0a22b00:   mov    %eax,-0x14000(%rsp)
            0x00007f13e0a22b07:   push   %rbp
            0x00007f13e0a22b08:   sub    $0x20,%rsp
            0x00007f13e0a22b0c:   cmpl   $0x1,0x20(%r15)
            0x00007f13e0a22b14:   jne    0x00007f13e0a22b96           ;*synchronization entry
                                                                      ; - java.lang.invoke.LambdaForm$DMH/0x000000080102c400::invokeStatic@-1
            0x00007f13e0a22b1a:   mov    %edx,%r10d
  0.12%     0x00007f13e0a22b1d:   mov    0x8(%rsi),%r8d               ; implicit exception: dispatches to 0x00007f13e0a22b71
  2.60%     0x00007f13e0a22b21:   cmp    $0xa37b0,%r8d                ;   {metadata(&apos;java/lang/invoke/DirectMethodHandle&apos;)}
0x00007f13e0a22b28:   jne    0x00007f13e0a22b53           ;*checkcast {reexecute=0 rethrow=0 return_oop=0}
                                                            ; - java.lang.invoke.DirectMethodHandle::internalMemberName@1 (line 327)
                                                            ; - java.lang.invoke.LambdaForm$DMH/0x000000080102c400::invokeStatic@1
0x00007f13e0a22b2a:   mov    0x20(%rsi),%r8d
0x00007f13e0a22b2e:   mov    %r8,%rdx
  0.12%  │  0x00007f13e0a22b31:   shl    $0x3,%rdx                    ;*getfield member {reexecute=0 rethrow=0 return_oop=0}
                                                            ; - java.lang.invoke.DirectMethodHandle::internalMemberName@4 (line 327)
                                                            ; - java.lang.invoke.LambdaForm$DMH/0x000000080102c400::invokeStatic@1
0x00007f13e0a22b35:   mov    %r10d,%esi
0x00007f13e0a22b38:   data16 xchg %ax,%ax
0x00007f13e0a22b3b:   call   0x00007f13e0a1eee0           ; ImmutableOopMap {}
                                                            ;*invokestatic linkToStatic {reexecute=0 rethrow=0 return_oop=0}
                                                            ; - java.lang.invoke.LambdaForm$DMH/0x000000080102c400::invokeStatic@10
                                                            ;   {static_call}
0x00007f13e0a22b40:   add    $0x20,%rsp
  0.24%  │  0x00007f13e0a22b44:   pop    %rbp
  1.06%  │  0x00007f13e0a22b45:   cmp    0x378(%r15),%rsp             ;   {poll_return}
0x00007f13e0a22b4c:   ja     0x00007f13e0a22b80
0x00007f13e0a22b52:   ret    
0x00007f13e0a22b53:   mov    %edx,%ebp
            0x00007f13e0a22b55:   mov    %rsi,(%rsp)
            0x00007f13e0a22b59:   mov    $0xffffff66,%esi
            0x00007f13e0a22b5e:   nop
            0x00007f13e0a22b5f:   call   0x00007f13e0233700           ; ImmutableOopMap {[0]=Oop }
                                                                      ;*checkcast {reexecute=0 rethrow=0 return_oop=0}
                                                                      ; - java.lang.invoke.DirectMethodHandle::internalMemberName@1 (line 327)
                                                                      ; - java.lang.invoke.LambdaForm$DMH/0x000000080102c400::invokeStatic@1
....................................................................................................
 14.54%  <total for region 1>

....[Hottest Region 2]..............................................................................
Unknown, level 0, java.lang.invoke.MethodHandle::invokeBasic, version 728 (25 bytes) 

           stub code      [0x00007f13e0a1f80a,0x00007f13e0a1f810] = 6
          [Disassembly]
          --------------------------------------------------------------------------------
          [Constant Pool (empty)]
          --------------------------------------------------------------------------------
          [Verified Entry Point]
            # {method} {0x00007f13a829ce28} &apos;invokeBasic&apos; &apos;(I)J&apos; in &apos;java/lang/invoke/MethodHandle&apos;
            # this:     rsi:rsi   = &apos;java/lang/invoke/MethodHandle&apos;
            # parm0:    rdx       = int
            #           [sp+0x0]  (sp of caller)
  3.07%     0x00007f13e0a1f7e0:   mov    0x14(%rsi),%ebx
            0x00007f13e0a1f7e3:   shl    $0x3,%rbx
            0x00007f13e0a1f7e7:   mov    0x28(%rbx),%ebx
            0x00007f13e0a1f7ea:   shl    $0x3,%rbx
            0x00007f13e0a1f7ee:   mov    0x24(%rbx),%ebx
  0.59%     0x00007f13e0a1f7f1:   shl    $0x3,%rbx
  0.47%     0x00007f13e0a1f7f5:   mov    0x10(%rbx),%rbx
  9.34%     0x00007f13e0a1f7f9:   test   %rbx,%rbx
0x00007f13e0a1f7fc:   je     0x00007f13e0a1f805
0x00007f13e0a1f802:   jmp    *0x40(%rbx)
0x00007f13e0a1f805:   jmp    0x00007f13e0283080           ;   {runtime_call AbstractMethodError throw_exception}
          [Stub Code]
            0x00007f13e0a1f80a:   hlt    
            0x00007f13e0a1f80b:   hlt    
            0x00007f13e0a1f80c:   hlt    
            0x00007f13e0a1f80d:   hlt    
            0x00007f13e0a1f80e:   hlt    
            0x00007f13e0a1f80f:   hlt    
....................................................................................................
 13.48%  <total for region 2>

....[Hottest Region 3]..............................................................................
c2, level 4, java.lang.invoke.LambdaForm$DMH.0x000000080102c000::invokeStatic, version 760 (69 bytes) 

          --------------------------------------------------------------------------------
          [Constant Pool (empty)]
          --------------------------------------------------------------------------------
          [Verified Entry Point]
            # {method} {0x00007f13a84d92a0} &apos;invokeStatic&apos; &apos;(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;J)V&apos; in &apos;java/lang/invoke/LambdaForm$DMH+0x000000080102c000&apos;
            # parm0:    rsi:rsi   = &apos;java/lang/Object&apos;
            # parm1:    rdx:rdx   = &apos;java/lang/Object&apos;
            # parm2:    rcx:rcx   = &apos;java/lang/Object&apos;
            # parm3:    r8:r8     = long
            #           [sp+0x40]  (sp of caller)
  8.75%     0x00007f13e0a23180:   mov    %eax,-0x14000(%rsp)
            0x00007f13e0a23187:   push   %rbp
  0.12%     0x00007f13e0a23188:   sub    $0x30,%rsp
            0x00007f13e0a2318c:   cmpl   $0x1,0x20(%r15)
            0x00007f13e0a23194:   jne    0x00007f13e0a2322a           ;*synchronization entry
                                                                      ; - java.lang.invoke.LambdaForm$DMH/0x000000080102c000::invokeStatic@-1
            0x00007f13e0a2319a:   mov    %r8,%r10
            0x00007f13e0a2319d:   mov    0x8(%rsi),%r8d               ; implicit exception: dispatches to 0x00007f13e0a231fd
  2.36%     0x00007f13e0a231a1:   cmp    $0xa37b0,%r8d                ;   {metadata(&apos;java/lang/invoke/DirectMethodHandle&apos;)}
0x00007f13e0a231a8:   jne    0x00007f13e0a231d3           ;*checkcast {reexecute=0 rethrow=0 return_oop=0}
                                                            ; - java.lang.invoke.DirectMethodHandle::internalMemberName@1 (line 327)
                                                            ; - java.lang.invoke.LambdaForm$DMH/0x000000080102c000::invokeStatic@1
0x00007f13e0a231aa:   mov    0x20(%rsi),%r8d
0x00007f13e0a231ae:   shl    $0x3,%r8                     ;*getfield member {reexecute=0 rethrow=0 return_oop=0}
                                                            ; - java.lang.invoke.DirectMethodHandle::internalMemberName@4 (line 327)
                                                            ; - java.lang.invoke.LambdaForm$DMH/0x000000080102c000::invokeStatic@1
0x00007f13e0a231b2:   mov    %rdx,%rsi
0x00007f13e0a231b5:   mov    %rcx,%rdx
  0.24%  │  0x00007f13e0a231b8:   mov    %r10,%rcx
0x00007f13e0a231bb:   call   0x00007f13e0a1e8e0           ; ImmutableOopMap {}
                                                            ;*invokestatic linkToStatic {reexecute=0 rethrow=0 return_oop=0}
                                                            ; - java.lang.invoke.LambdaForm$DMH/0x000000080102c000::invokeStatic@14
                                                            ;   {static_call}
0x00007f13e0a231c0:   add    $0x30,%rsp
0x00007f13e0a231c4:   pop    %rbp
  1.65%  │  0x00007f13e0a231c5:   cmp    0x378(%r15),%rsp             ;   {poll_return}
0x00007f13e0a231cc:   ja     0x00007f13e0a23214
0x00007f13e0a231d2:   ret    
0x00007f13e0a231d3:   mov    %rdx,%rbp
            0x00007f13e0a231d6:   mov    %rcx,(%rsp)
            0x00007f13e0a231da:   mov    %r10,0x8(%rsp)
            0x00007f13e0a231df:   mov    %rsi,0x10(%rsp)
            0x00007f13e0a231e4:   mov    $0xffffff66,%esi
            0x00007f13e0a231e9:   xchg   %ax,%ax
            0x00007f13e0a231eb:   call   0x00007f13e0233700           ; ImmutableOopMap {rbp=Oop [0]=Oop [16]=Oop }
                                                                      ;*checkcast {reexecute=0 rethrow=0 return_oop=0}
....................................................................................................
 13.12%  <total for region 3>

....[Hottest Region 4]..............................................................................
Unknown, level 0, java.lang.invoke.MethodHandle::invokeBasic, version 732 (25 bytes) 

          --------------------------------------------------------------------------------
          [Constant Pool (empty)]
          --------------------------------------------------------------------------------
          [Verified Entry Point]
            # {method} {0x00007f13a829d238} &apos;invokeBasic&apos; &apos;(Ljava/lang/Object;Ljava/lang/Object;I)V&apos; in &apos;java/lang/invoke/MethodHandle&apos;
            # this:     rsi:rsi   = &apos;java/lang/invoke/MethodHandle&apos;
            # parm0:    rdx:rdx   = &apos;java/lang/Object&apos;
            # parm1:    rcx:rcx   = &apos;java/lang/Object&apos;
            # parm2:    r8        = int
            #           [sp+0x0]  (sp of caller)
  1.18%     0x00007f13e0a1fde0:   mov    0x14(%rsi),%ebx
            0x00007f13e0a1fde3:   shl    $0x3,%rbx
            0x00007f13e0a1fde7:   mov    0x28(%rbx),%ebx
  0.24%     0x00007f13e0a1fdea:   shl    $0x3,%rbx
            0x00007f13e0a1fdee:   mov    0x24(%rbx),%ebx
  2.25%     0x00007f13e0a1fdf1:   shl    $0x3,%rbx
  1.06%     0x00007f13e0a1fdf5:   mov    0x10(%rbx),%rbx
  8.04%     0x00007f13e0a1fdf9:   test   %rbx,%rbx
0x00007f13e0a1fdfc:   je     0x00007f13e0a1fe05
0x00007f13e0a1fe02:   jmp    *0x40(%rbx)
0x00007f13e0a1fe05:   jmp    0x00007f13e0283080           ;   {runtime_call AbstractMethodError throw_exception}
          [Stub Code]
            0x00007f13e0a1fe0a:   hlt    
            0x00007f13e0a1fe0b:   hlt    
            0x00007f13e0a1fe0c:   hlt    
            0x00007f13e0a1fe0d:   hlt    
            0x00007f13e0a1fe0e:   hlt    
            0x00007f13e0a1fe0f:   hlt    
....................................................................................................
 12.77%  <total for region 4>

....[Hottest Region 5]..............................................................................
perf-141975.map, [unknown] (0 bytes) 

 <no assembly is recorded, native region>
....................................................................................................
 11.23%  <total for region 5>

....[Hottest Regions]...............................................................................
 14.54%         c2, level 4  java.lang.invoke.LambdaForm$DMH.0x000000080102c400::invokeStatic, version 758 (69 bytes) 
 13.48%    Unknown, level 0  java.lang.invoke.MethodHandle::invokeBasic, version 728 (25 bytes) 
 13.12%         c2, level 4  java.lang.invoke.LambdaForm$DMH.0x000000080102c000::invokeStatic, version 760 (69 bytes) 
 12.77%    Unknown, level 0  java.lang.invoke.MethodHandle::invokeBasic, version 732 (25 bytes) 
 11.23%     perf-141975.map  [unknown] (0 bytes) 
  6.86%         c2, level 4  java.lang.invoke.VarHandleLongs$FieldInstanceReadWrite::setRelease, version 761 (110 bytes) 
  4.61%    Unknown, level 0  java.lang.invoke.MethodHandle::invokeBasic, version 725 (15 bytes) 
  4.26%         c2, level 4  java.lang.invoke.LambdaForm$MH.0x000000080102d000::invoke, version 757 (29 bytes) 
  3.07%         c2, level 4  java.lang.invoke.LambdaForm$MH.0x000000080102d000::invoke, version 757 (18 bytes) 
  2.60%    Unknown, level 0  java.lang.invoke.MethodHandle::linkToStatic, version 722 (4 bytes) 
  2.48%    Unknown, level 0  java.lang.invoke.MethodHandle::linkToStatic, version 724 (4 bytes) 
  2.25%         c2, level 4  sun.invoke.util.ValueConversions::intToLong, version 759 (7 bytes) 
  1.77%         c2, level 4  red.hat.puzzles.concurrent.jmh_generated.StoreOps_vhSetRelease_jmhTest::vhSetRelease_avgt_jmhStub, version 785 (58 bytes) 
  1.42%   [kernel.kallsyms]  finish_task_switch.isra.0 (0 bytes) 
  0.95%                      <unknown> (0 bytes) 
  0.47%   [kernel.kallsyms]  schedule (0 bytes) 
  0.35%           libjvm.so  ElfSymbolTable::lookup (44 bytes) 
  0.24%   [kernel.kallsyms]  __entry_text_start (0 bytes) 
  0.24%           libc.so.6  __printf_buffer (11 bytes) 
  0.12%   [kernel.kallsyms]  osq_unlock (0 bytes) 
  3.07%  <...other 26 warm regions...>
....................................................................................................
 99.88%  <totals>

....[Hottest Methods (after inlining)]..............................................................
 14.54%         c2, level 4  java.lang.invoke.LambdaForm$DMH.0x000000080102c400::invokeStatic, version 758 
 13.48%    Unknown, level 0  java.lang.invoke.MethodHandle::invokeBasic, version 728 
 13.12%         c2, level 4  java.lang.invoke.LambdaForm$DMH.0x000000080102c000::invokeStatic, version 760 
 12.77%    Unknown, level 0  java.lang.invoke.MethodHandle::invokeBasic, version 732 
 11.23%     perf-141975.map  [unknown] 
  7.33%         c2, level 4  java.lang.invoke.LambdaForm$MH.0x000000080102d000::invoke, version 757 
  6.86%         c2, level 4  java.lang.invoke.VarHandleLongs$FieldInstanceReadWrite::setRelease, version 761 
  4.61%    Unknown, level 0  java.lang.invoke.MethodHandle::invokeBasic, version 725 
  2.60%    Unknown, level 0  java.lang.invoke.MethodHandle::linkToStatic, version 722 
  2.48%    Unknown, level 0  java.lang.invoke.MethodHandle::linkToStatic, version 724 
  2.25%         c2, level 4  sun.invoke.util.ValueConversions::intToLong, version 759 
  1.77%         c2, level 4  red.hat.puzzles.concurrent.jmh_generated.StoreOps_vhSetRelease_jmhTest::vhSetRelease_avgt_jmhStub, version 785 
  1.42%   [kernel.kallsyms]  finish_task_switch.isra.0 
  0.95%                      <unknown> 
  0.47%   [kernel.kallsyms]  schedule 
  0.35%           libjvm.so  ElfSymbolTable::lookup 
  0.24%           libc.so.6  __printf_buffer 
  0.24%   [kernel.kallsyms]  __entry_text_start 
  0.12%   [kernel.kallsyms]  __handle_mm_fault 
  0.12%           libjvm.so  ciSignature::ciSignature 
  2.96%  <...other 25 warm methods...>
....................................................................................................
 99.88%  <totals>

....[Distribution by Source]........................................................................
 45.86%         c2, level 4
 35.93%    Unknown, level 0
 11.23%     perf-141975.map
  4.02%   [kernel.kallsyms]
  1.30%           libjvm.so
  0.95%                    
  0.24%         interpreter
  0.24%           libc.so.6
  0.12%         c1, level 3
....................................................................................................
 99.88%  <totals>

WARNING: The perf event count is suspiciously low (846). The performance data might be
inaccurate or misleading. Try to do the profiling again, or tune up the sampling frequency.
With some profilers on Mac OS X, System Integrity Protection (SIP) may prevent profiling.
In such case, temporarily disabling SIP with 'csrutil disable' might help.
PrintAssembly processed: 188993 total address lines.
Perf output processed (skipped 5.348 seconds):
 Column 1: cycles (836 events)

Hottest code regions (>10.00% "cycles" events):

....[Hottest Region 1]..............................................................................
c2, level 4, java.lang.invoke.LambdaForm$DMH.0x000000080102c000::invokeStatic, version 765 (69 bytes) 

          --------------------------------------------------------------------------------
          [Constant Pool (empty)]
          --------------------------------------------------------------------------------
          [Verified Entry Point]
            # {method} {0x00007fe9644d92a0} &apos;invokeStatic&apos; &apos;(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;J)V&apos; in &apos;java/lang/invoke/LambdaForm$DMH+0x000000080102c000&apos;
            # parm0:    rsi:rsi   = &apos;java/lang/Object&apos;
            # parm1:    rdx:rdx   = &apos;java/lang/Object&apos;
            # parm2:    rcx:rcx   = &apos;java/lang/Object&apos;
            # parm3:    r8:r8     = long
            #           [sp+0x40]  (sp of caller)
  4.67%     0x00007fe99ca22980:   mov    %eax,-0x14000(%rsp)
            0x00007fe99ca22987:   push   %rbp
  0.12%     0x00007fe99ca22988:   sub    $0x30,%rsp
            0x00007fe99ca2298c:   cmpl   $0x1,0x20(%r15)
            0x00007fe99ca22994:   jne    0x00007fe99ca22a2a           ;*synchronization entry
                                                                      ; - java.lang.invoke.LambdaForm$DMH/0x000000080102c000::invokeStatic@-1
            0x00007fe99ca2299a:   mov    %r8,%r10
  3.83%     0x00007fe99ca2299d:   mov    0x8(%rsi),%r8d               ; implicit exception: dispatches to 0x00007fe99ca229fd
  0.72%     0x00007fe99ca229a1:   cmp    $0xa37b0,%r8d                ;   {metadata(&apos;java/lang/invoke/DirectMethodHandle&apos;)}
0x00007fe99ca229a8:   jne    0x00007fe99ca229d3           ;*checkcast {reexecute=0 rethrow=0 return_oop=0}
                                                            ; - java.lang.invoke.DirectMethodHandle::internalMemberName@1 (line 327)
                                                            ; - java.lang.invoke.LambdaForm$DMH/0x000000080102c000::invokeStatic@1
0x00007fe99ca229aa:   mov    0x20(%rsi),%r8d
0x00007fe99ca229ae:   shl    $0x3,%r8                     ;*getfield member {reexecute=0 rethrow=0 return_oop=0}
                                                            ; - java.lang.invoke.DirectMethodHandle::internalMemberName@4 (line 327)
                                                            ; - java.lang.invoke.LambdaForm$DMH/0x000000080102c000::invokeStatic@1
0x00007fe99ca229b2:   mov    %rdx,%rsi
0x00007fe99ca229b5:   mov    %rcx,%rdx
0x00007fe99ca229b8:   mov    %r10,%rcx
0x00007fe99ca229bb:   call   0x00007fe99ca1ebe0           ; ImmutableOopMap {}
                                                            ;*invokestatic linkToStatic {reexecute=0 rethrow=0 return_oop=0}
                                                            ; - java.lang.invoke.LambdaForm$DMH/0x000000080102c000::invokeStatic@14
                                                            ;   {static_call}
  8.01%  │  0x00007fe99ca229c0:   add    $0x30,%rsp
0x00007fe99ca229c4:   pop    %rbp
  0.60%  │  0x00007fe99ca229c5:   cmp    0x378(%r15),%rsp             ;   {poll_return}
0x00007fe99ca229cc:   ja     0x00007fe99ca22a14
0x00007fe99ca229d2:   ret    
0x00007fe99ca229d3:   mov    %rdx,%rbp
            0x00007fe99ca229d6:   mov    %rcx,(%rsp)
            0x00007fe99ca229da:   mov    %r10,0x8(%rsp)
            0x00007fe99ca229df:   mov    %rsi,0x10(%rsp)
            0x00007fe99ca229e4:   mov    $0xffffff66,%esi
            0x00007fe99ca229e9:   xchg   %ax,%ax
            0x00007fe99ca229eb:   call   0x00007fe99c233700           ; ImmutableOopMap {rbp=Oop [0]=Oop [16]=Oop }
                                                                      ;*checkcast {reexecute=0 rethrow=0 return_oop=0}
....................................................................................................
 17.94%  <total for region 1>

....[Hottest Region 2]..............................................................................
Unknown, level 0, java.lang.invoke.MethodHandle::invokeBasic, version 730 (25 bytes) 

          --------------------------------------------------------------------------------
          [Constant Pool (empty)]
          --------------------------------------------------------------------------------
          [Verified Entry Point]
            # {method} {0x00007fe96429c218} &apos;invokeBasic&apos; &apos;(Ljava/lang/Object;Ljava/lang/Object;J)V&apos; in &apos;java/lang/invoke/MethodHandle&apos;
            # this:     rsi:rsi   = &apos;java/lang/invoke/MethodHandle&apos;
            # parm0:    rdx:rdx   = &apos;java/lang/Object&apos;
            # parm1:    rcx:rcx   = &apos;java/lang/Object&apos;
            # parm2:    r8:r8     = long
            #           [sp+0x0]  (sp of caller)
  7.54%     0x00007fe99ca1f4e0:   mov    0x14(%rsi),%ebx
            0x00007fe99ca1f4e3:   shl    $0x3,%rbx
            0x00007fe99ca1f4e7:   mov    0x28(%rbx),%ebx
  0.12%     0x00007fe99ca1f4ea:   shl    $0x3,%rbx
  1.32%     0x00007fe99ca1f4ee:   mov    0x24(%rbx),%ebx
            0x00007fe99ca1f4f1:   shl    $0x3,%rbx
            0x00007fe99ca1f4f5:   mov    0x10(%rbx),%rbx
  8.73%     0x00007fe99ca1f4f9:   test   %rbx,%rbx
0x00007fe99ca1f4fc:   je     0x00007fe99ca1f505
0x00007fe99ca1f502:   jmp    *0x40(%rbx)
0x00007fe99ca1f505:   jmp    0x00007fe99c283080           ;   {runtime_call AbstractMethodError throw_exception}
          [Stub Code]
            0x00007fe99ca1f50a:   hlt    
            0x00007fe99ca1f50b:   hlt    
            0x00007fe99ca1f50c:   hlt    
            0x00007fe99ca1f50d:   hlt    
            0x00007fe99ca1f50e:   hlt    
            0x00007fe99ca1f50f:   hlt    
....................................................................................................
 17.70%  <total for region 2>

....[Hottest Region 3]..............................................................................
c2, level 4, java.lang.invoke.LambdaForm$MH.0x000000080102d000::invoke, version 763 (140 bytes) 

          --------------------------------------------------------------------------------
          [Constant Pool (empty)]
          --------------------------------------------------------------------------------
          [Verified Entry Point]
            # {method} {0x00007fe9644db2d0} &apos;invoke&apos; &apos;(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;I)V&apos; in &apos;java/lang/invoke/LambdaForm$MH+0x000000080102d000&apos;
            # parm0:    rsi:rsi   = &apos;java/lang/Object&apos;
            # parm1:    rdx:rdx   = &apos;java/lang/Object&apos;
            # parm2:    rcx:rcx   = &apos;java/lang/Object&apos;
            # parm3:    r8        = int
            #           [sp+0x40]  (sp of caller)
  2.39%     0x00007fe99ca223a0:   mov    %eax,-0x14000(%rsp)
            0x00007fe99ca223a7:   push   %rbp
  0.12%     0x00007fe99ca223a8:   sub    $0x30,%rsp
            0x00007fe99ca223ac:   cmpl   $0x1,0x20(%r15)
            0x00007fe99ca223b4:   jne    0x00007fe99ca224e2           ;*synchronization entry
                                                                      ; - java.lang.invoke.LambdaForm$MH/0x000000080102d000::invoke@-1
            0x00007fe99ca223ba:   mov    %rcx,0x8(%rsp)
            0x00007fe99ca223bf:   mov    %rdx,(%rsp)
  0.72%     0x00007fe99ca223c3:   mov    0x8(%rsi),%r10d              ; implicit exception: dispatches to 0x00007fe99ca22482
            0x00007fe99ca223c7:   cmp    $0x235c10,%r10d              ;   {metadata(&apos;java/lang/invoke/BoundMethodHandle$Species_LL&apos;)}
0x00007fe99ca223ce:   jne    0x00007fe99ca22433           ;*checkcast {reexecute=0 rethrow=0 return_oop=0}
                                                            ; - java.lang.invoke.LambdaForm$MH/0x000000080102d000::invoke@1
0x00007fe99ca223d0:   mov    %rsi,0x18(%rsp)
  0.60%  │  0x00007fe99ca223d5:   mov    0x24(%rsi),%ebp              ;*getfield argL1 {reexecute=0 rethrow=0 return_oop=0}
                                                            ; - java.lang.invoke.LambdaForm$MH/0x000000080102d000::invoke@6
0x00007fe99ca223d8:   mov    0x8(%r12,%rbp,8),%r10d       ; implicit exception: dispatches to 0x00007fe99ca22498
  0.24%  │  0x00007fe99ca223dd:   cmp    $0xa37b0,%r10d               ;   {metadata(&apos;java/lang/invoke/DirectMethodHandle&apos;)}
0x00007fe99ca223e4:   jne    0x00007fe99ca22450
0x00007fe99ca223e6:   lea    (%r12,%rbp,8),%rsi           ;*checkcast {reexecute=0 rethrow=0 return_oop=0}
                                                            ; - java.lang.invoke.LambdaForm$MH/0x000000080102d000::invoke@13
0x00007fe99ca223ea:   mov    %r8d,%edx
0x00007fe99ca223ed:   xchg   %ax,%ax
0x00007fe99ca223ef:   call   0x00007fe99ca1fae0           ; ImmutableOopMap {[0]=Oop [8]=Oop [24]=Oop }
                                                            ;*invokevirtual invokeBasic {reexecute=0 rethrow=0 return_oop=0}
                                                            ; - java.lang.invoke.LambdaForm$MH/0x000000080102d000::invoke@17
                                                            ;   {optimized virtual_call}
  4.43%  │  0x00007fe99ca223f4:   mov    0x18(%rsp),%r10
0x00007fe99ca223f9:   mov    0x20(%r10),%ebp              ;*getfield argL0 {reexecute=0 rethrow=0 return_oop=0}
                                                            ; - java.lang.invoke.LambdaForm$MH/0x000000080102d000::invoke@23
0x00007fe99ca223fd:   mov    0x8(%r12,%rbp,8),%r11d       ; implicit exception: dispatches to 0x00007fe99ca224b0
0x00007fe99ca22402:   cmp    $0xa37b0,%r11d               ;   {metadata(&apos;java/lang/invoke/DirectMethodHandle&apos;)}
0x00007fe99ca22409:   jne    0x00007fe99ca22460
0x00007fe99ca2240b:   lea    (%r12,%rbp,8),%rsi           ;*checkcast {reexecute=0 rethrow=0 return_oop=0}
                                                            ; - java.lang.invoke.LambdaForm$MH/0x000000080102d000::invoke@30
  0.12%  │  0x00007fe99ca2240f:   mov    (%rsp),%rdx
  0.84%  │  0x00007fe99ca22413:   mov    0x8(%rsp),%rcx
0x00007fe99ca22418:   mov    %rax,%r8
0x00007fe99ca2241b:   call   0x00007fe99ca1f4e0           ; ImmutableOopMap {}
                                                            ;*invokevirtual invokeBasic {reexecute=0 rethrow=0 return_oop=0}
                                                            ; - java.lang.invoke.LambdaForm$MH/0x000000080102d000::invoke@37
                                                            ;   {optimized virtual_call}
0x00007fe99ca22420:   add    $0x30,%rsp
  4.67%  │  0x00007fe99ca22424:   pop    %rbp
0x00007fe99ca22425:   cmp    0x378(%r15),%rsp             ;   {poll_return}
  0.12%  │  0x00007fe99ca2242c:   ja     0x00007fe99ca224cc
0x00007fe99ca22432:   ret    
0x00007fe99ca22433:   mov    %rdx,%rbp
            0x00007fe99ca22436:   mov    %rcx,(%rsp)
            0x00007fe99ca2243a:   mov    %r8d,0x8(%rsp)
            0x00007fe99ca2243f:   mov    %rsi,0x10(%rsp)
            0x00007fe99ca22444:   mov    $0xffffff66,%esi
            0x00007fe99ca22449:   xchg   %ax,%ax
            0x00007fe99ca2244b:   call   0x00007fe99c233700           ; ImmutableOopMap {rbp=Oop [0]=Oop [16]=Oop }
                                                                      ;*checkcast {reexecute=0 rethrow=0 return_oop=0}
                                                                      ; - java.lang.invoke.LambdaForm$MH/0x000000080102d000::invoke@1
....................................................................................................
 14.23%  <total for region 3>

....[Hottest Region 4]..............................................................................
c2, level 4, java.lang.invoke.VarHandleLongs$FieldInstanceReadWrite::setRelease, version 766 (102 bytes) 

           [Disassembly]
           --------------------------------------------------------------------------------
           [Constant Pool (empty)]
           --------------------------------------------------------------------------------
           [Verified Entry Point]
             # {method} {0x000000080024f218} &apos;setRelease&apos; &apos;(Ljava/lang/invoke/VarHandle;Ljava/lang/Object;J)V&apos; in &apos;java/lang/invoke/VarHandleLongs$FieldInstanceReadWrite&apos;
             # parm0:    rsi:rsi   = &apos;java/lang/invoke/VarHandle&apos;
             # parm1:    rdx:rdx   = &apos;java/lang/Object&apos;
             # parm2:    rcx:rcx   = long
             #           [sp+0x40]  (sp of caller)
  0.24%      0x00007fe99ca23380:   mov    %eax,-0x14000(%rsp)
             0x00007fe99ca23387:   push   %rbp
  4.31%      0x00007fe99ca23388:   sub    $0x30,%rsp
  0.84%      0x00007fe99ca2338c:   cmpl   $0x1,0x20(%r15)
  0.12%      0x00007fe99ca23394:   jne    0x00007fe99ca2349a           ;*synchronization entry
                                                                       ; - java.lang.invoke.VarHandleLongs$FieldInstanceReadWrite::setRelease@-1 (line 169)
             0x00007fe99ca2339a:   mov    %rcx,%r10
             0x00007fe99ca2339d:   mov    %rsi,%rbx
             0x00007fe99ca233a0:   mov    0x8(%rsi),%r11d              ; implicit exception: dispatches to 0x00007fe99ca2344c
             0x00007fe99ca233a4:   cmp    $0x24e558,%r11d              ;   {metadata(&apos;java/lang/invoke/VarHandleLongs$FieldInstanceReadWrite&apos;)}
  2.63%      0x00007fe99ca233ab:   jne    0x00007fe99ca23434           ;*checkcast {reexecute=0 rethrow=0 return_oop=0}
                                                                       ; - java.lang.invoke.VarHandleLongs$FieldInstanceReadWrite::setRelease@1 (line 169)
             0x00007fe99ca233b1:   mov    0x1c(%rbx),%ebp              ;*getfield receiverType {reexecute=0 rethrow=0 return_oop=0}
                                                                       ; - java.lang.invoke.VarHandleLongs$FieldInstanceReadWrite::setRelease@11 (line 170)
  0.12%      0x00007fe99ca233b4:   mov    0x10(%r12,%rbp,8),%rax       ; implicit exception: dispatches to 0x00007fe99ca23460
  0.36%      0x00007fe99ca233b9:   mov    0x14(%rax),%r9d              ; implicit exception: dispatches to 0x00007fe99ca2341c
  0.60%      0x00007fe99ca233bd:   mov    0x8(%rdx),%r8d               ; implicit exception: dispatches to 0x00007fe99ca23470
             0x00007fe99ca233c1:   movslq %r9d,%r11
             0x00007fe99ca233c4:   movabs $0x800000000,%rsi
  0.24%      0x00007fe99ca233ce:   add    %r8,%rsi
             0x00007fe99ca233d1:   mov    (%rsi,%r11,1),%r11
  1.32%      0x00007fe99ca233d5:   cmp    %r11,%rax
0x00007fe99ca233d8:   jne    0x00007fe99ca233f5           ;*invokevirtual putLongRelease {reexecute=0 rethrow=0 return_oop=0}
                                                             ; - java.lang.invoke.VarHandleLongs$FieldInstanceReadWrite::setRelease@27 (line 170)
         │↗  0x00007fe99ca233da:   mov    0x20(%rbx),%r11              ;*getfield fieldOffset {reexecute=0 rethrow=0 return_oop=0}
         ││                                                            ; - java.lang.invoke.VarHandleLongs$FieldInstanceReadWrite::setRelease@23 (line 170)
         ││  0x00007fe99ca233de:   mov    %r10,(%rdx,%r11,1)           ;*invokevirtual putLongRelease {reexecute=0 rethrow=0 return_oop=0}
         ││                                                            ; - java.lang.invoke.VarHandleLongs$FieldInstanceReadWrite::setRelease@27 (line 170)
  0.36%  ││  0x00007fe99ca233e2:   add    $0x30,%rsp
  0.24%  ││  0x00007fe99ca233e6:   pop    %rbp
         ││  0x00007fe99ca233e7:   cmp    0x378(%r15),%rsp             ;   {poll_return}
         ││  0x00007fe99ca233ee:   ja     0x00007fe99ca23484
         ││  0x00007fe99ca233f4:   ret    
         ↘│  0x00007fe99ca233f5:   cmp    $0x20,%r9d
0x00007fe99ca233f9:   jne    0x00007fe99ca2341c
0x00007fe99ca233fb:   cmp    %rax,%rsi
0x00007fe99ca233fe:   je     0x00007fe99ca233da
             0x00007fe99ca23400:   mov    0x28(%rsi),%rdi
             0x00007fe99ca23404:   mov    (%rdi),%ecx
             0x00007fe99ca23406:   add    $0x8,%rdi
....................................................................................................
 11.36%  <total for region 4>

....[Hottest Regions]...............................................................................
 17.94%         c2, level 4  java.lang.invoke.LambdaForm$DMH.0x000000080102c000::invokeStatic, version 765 (69 bytes) 
 17.70%    Unknown, level 0  java.lang.invoke.MethodHandle::invokeBasic, version 730 (25 bytes) 
 14.23%         c2, level 4  java.lang.invoke.LambdaForm$MH.0x000000080102d000::invoke, version 763 (140 bytes) 
 11.36%         c2, level 4  java.lang.invoke.VarHandleLongs$FieldInstanceReadWrite::setRelease, version 766 (102 bytes) 
  5.38%         c2, level 4  sun.invoke.util.ValueConversions::intToLong, version 764 (41 bytes) 
  5.02%    Unknown, level 0  java.lang.invoke.MethodHandle::invokeBasic, version 737 (25 bytes) 
  4.31%    Unknown, level 0  java.lang.invoke.MethodHandle::invokeBasic, version 733 (25 bytes) 
  3.95%         c2, level 4  red.hat.puzzles.concurrent.jmh_generated.StoreOps_vhSetRelease_jmhTest::vhSetRelease_avgt_jmhStub, version 789 (0 bytes) 
  3.83%    Unknown, level 0  java.lang.invoke.MethodHandle::linkToStatic, version 727 (4 bytes) 
  3.59%         c2, level 4  java.lang.invoke.LambdaForm$DMH.0x000000080102c400::invokeStatic, version 761 (33 bytes) 
  2.15%         c2, level 4  red.hat.puzzles.concurrent.jmh_generated.StoreOps_vhSetRelease_jmhTest::vhSetRelease_avgt_jmhStub, version 789 (0 bytes) 
  1.79%    Unknown, level 0  java.lang.invoke.MethodHandle::linkToStatic, version 729 (11 bytes) 
  1.56%   [kernel.kallsyms]  _raw_spin_unlock (2 bytes) 
  1.08%   [kernel.kallsyms]  finish_task_switch.isra.0 (0 bytes) 
  0.96%                      <unknown> (0 bytes) 
  0.60%         c2, level 4  java.lang.invoke.LambdaForm$DMH.0x000000080102c400::invokeStatic, version 761 (1 bytes) 
  0.48%   [kernel.kallsyms]  finish_task_switch.isra.0 (0 bytes) 
  0.48%   [kernel.kallsyms]  futex_wait_queue (0 bytes) 
  0.48%   [kernel.kallsyms]  schedule (0 bytes) 
  0.12%   [kernel.kallsyms]  arch_do_signal_or_restart (0 bytes) 
  2.87%  <...other 24 warm regions...>
....................................................................................................
 99.88%  <totals>

....[Hottest Methods (after inlining)]..............................................................
 17.94%         c2, level 4  java.lang.invoke.LambdaForm$DMH.0x000000080102c000::invokeStatic, version 765 
 17.70%    Unknown, level 0  java.lang.invoke.MethodHandle::invokeBasic, version 730 
 14.23%         c2, level 4  java.lang.invoke.LambdaForm$MH.0x000000080102d000::invoke, version 763 
 11.36%         c2, level 4  java.lang.invoke.VarHandleLongs$FieldInstanceReadWrite::setRelease, version 766 
  6.10%         c2, level 4  red.hat.puzzles.concurrent.jmh_generated.StoreOps_vhSetRelease_jmhTest::vhSetRelease_avgt_jmhStub, version 789 
  5.38%         c2, level 4  sun.invoke.util.ValueConversions::intToLong, version 764 
  5.02%    Unknown, level 0  java.lang.invoke.MethodHandle::invokeBasic, version 737 
  4.31%    Unknown, level 0  java.lang.invoke.MethodHandle::invokeBasic, version 733 
  4.19%         c2, level 4  java.lang.invoke.LambdaForm$DMH.0x000000080102c400::invokeStatic, version 761 
  3.83%    Unknown, level 0  java.lang.invoke.MethodHandle::linkToStatic, version 727 
  1.79%    Unknown, level 0  java.lang.invoke.MethodHandle::linkToStatic, version 729 
  1.56%   [kernel.kallsyms]  finish_task_switch.isra.0 
  1.56%   [kernel.kallsyms]  _raw_spin_unlock 
  1.32%                      <unknown> 
  0.48%   [kernel.kallsyms]  schedule 
  0.48%   [kernel.kallsyms]  futex_wait_queue 
  0.12%           libc.so.6  __printf_buffer 
  0.12%   [kernel.kallsyms]  __mutex_lock.constprop.0 
  0.12%   [kernel.kallsyms]  __task_pid_nr_ns 
  0.12%   [kernel.kallsyms]  selinux_file_permission 
  2.15%  <...other 18 warm methods...>
....................................................................................................
 99.88%  <totals>

....[Distribution by Source]........................................................................
 59.21%         c2, level 4
 32.66%    Unknown, level 0
  5.62%   [kernel.kallsyms]
  1.32%                    
  0.60%           libjvm.so
  0.36%           libc.so.6
  0.12%         interpreter
....................................................................................................
 99.88%  <totals>

WARNING: The perf event count is suspiciously low (836). The performance data might be
inaccurate or misleading. Try to do the profiling again, or tune up the sampling frequency.
With some profilers on Mac OS X, System Integrity Protection (SIP) may prevent profiling.
In such case, temporarily disabling SIP with 'csrutil disable' might help.


# Run complete. Total time: 00:00:30

REMEMBER: The numbers below are just data. To gain reusable insights, you need to follow up on
why the numbers are the way they are. Use profilers (see -prof, -lprof), design factorial
experiments, perform baseline and negative tests that provide experimental control, make sure
the benchmarking environment is safe on JVM/OS/HW level, ask for reviews from the domain experts.
Do not assume the numbers tell you what you want them to tell.

NOTE: Current JVM experimentally supports Compiler Blackholes, and they are in use. Please exercise
extra caution when trusting the results, look into the generated code to check the benchmark still
works, and factor in a small probability of new VM bugs. Additionally, while comparisons between
different JVMs are already problematic, the performance difference caused by different Blackhole
modes can be very significant. Please make sure you use the consistent Blackhole mode for comparisons.

Benchmark                        Mode  Cnt  Score   Error  Units
StoreOps.updaterSetRelease       avgt   10  0.352 ± 0.007  ns/op
StoreOps.updaterSetRelease:·asm  avgt         NaN            ---
StoreOps.vhSetRelease            avgt   10  8.631 ± 0.017  ns/op
StoreOps.vhSetRelease:·asm       avgt         NaN            ---

@franz1981
Copy link
Author

perfnorm if very esplicit:

Benchmark                                           Mode  Cnt    Score   Error      Units
StoreOps.updaterSetRelease                          avgt   10    0.358 ± 0.007      ns/op
StoreOps.updaterSetRelease:CPI                      avgt    2    0.231          clks/insn
StoreOps.updaterSetRelease:IPC                      avgt    2    4.331          insns/clk
StoreOps.updaterSetRelease:L1-dcache-load-misses    avgt    2    0.001               #/op
StoreOps.updaterSetRelease:L1-dcache-loads          avgt    2    4.187               #/op
StoreOps.updaterSetRelease:L1-icache-load-misses    avgt    2   ≈ 10⁻⁴               #/op
StoreOps.updaterSetRelease:L1-icache-loads          avgt    2    0.003               #/op
StoreOps.updaterSetRelease:branch-misses            avgt    2   ≈ 10⁻⁴               #/op
StoreOps.updaterSetRelease:branches                 avgt    2    1.049               #/op
StoreOps.updaterSetRelease:cycles                   avgt    2    1.696               #/op
StoreOps.updaterSetRelease:dTLB-load-misses         avgt    2   ≈ 10⁻⁵               #/op
StoreOps.updaterSetRelease:dTLB-loads               avgt    2   ≈ 10⁻⁴               #/op
StoreOps.updaterSetRelease:iTLB-load-misses         avgt    2   ≈ 10⁻⁵               #/op
StoreOps.updaterSetRelease:iTLB-loads               avgt    2   ≈ 10⁻⁵               #/op
StoreOps.updaterSetRelease:instructions             avgt    2    7.342               #/op
StoreOps.updaterSetRelease:stalled-cycles-backend   avgt    2    0.002               #/op
StoreOps.updaterSetRelease:stalled-cycles-frontend  avgt    2    0.001               #/op
StoreOps.vhSetRelease                               avgt   10    8.641 ± 0.013      ns/op
StoreOps.vhSetRelease:CPI                           avgt    2    0.225          clks/insn
StoreOps.vhSetRelease:IPC                           avgt    2    4.442          insns/clk
StoreOps.vhSetRelease:L1-dcache-load-misses         avgt    2    0.009               #/op
StoreOps.vhSetRelease:L1-dcache-loads               avgt    2   74.030               #/op
StoreOps.vhSetRelease:L1-icache-load-misses         avgt    2    0.001               #/op
StoreOps.vhSetRelease:L1-icache-loads               avgt    2    0.046               #/op
StoreOps.vhSetRelease:branch-misses                 avgt    2    0.004               #/op
StoreOps.vhSetRelease:branches                      avgt    2   39.882               #/op
StoreOps.vhSetRelease:cycles                        avgt    2   39.013               #/op
StoreOps.vhSetRelease:dTLB-load-misses              avgt    2   ≈ 10⁻³               #/op
StoreOps.vhSetRelease:dTLB-loads                    avgt    2    0.002               #/op
StoreOps.vhSetRelease:iTLB-load-misses              avgt    2   ≈ 10⁻⁴               #/op
StoreOps.vhSetRelease:iTLB-loads                    avgt    2   ≈ 10⁻⁴               #/op
StoreOps.vhSetRelease:instructions                  avgt    2  173.284               #/op
StoreOps.vhSetRelease:stalled-cycles-backend        avgt    2    0.041               #/op
StoreOps.vhSetRelease:stalled-cycles-frontend       avgt    2    0.020               #/op

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