Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Unsafe vs primitive array traversal speed
> java -ea -jar benchmark/target/benchmarks.jar UnsafeBenchmark -wi 2 -i 2 -f 1
# JMH 1.6.2 (released 8 days ago)
# VM invoker: /Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home/jre/bin/java
# VM options: -ea
# Warmup: 2 iterations, 1 s each
# Measurement: 2 iterations, 1 s each
# Timeout: 10 min per iteration
# Threads: 1 thread, will synchronize iterations
# Benchmark mode: Throughput, ops/time
# Benchmark: com.databricks.unsafe.util.benchmark.UnsafeBenchmark.arrayTraversal
# Parameters: (size = 1048576)
# Run progress: 0.00% complete, ETA 00:00:12
# Fork: 1 of 1
# Warmup Iteration 1: 2673.986 ops/s
# Warmup Iteration 2: 2546.964 ops/s
Iteration 1: 2493.137 ops/s
Iteration 2: 2738.984 ops/s
Run result: 2616.06 ops/s (<= 2 samples)
# JMH 1.6.2 (released 8 days ago)
# VM invoker: /Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home/jre/bin/java
# VM options: -ea
# Warmup: 2 iterations, 1 s each
# Measurement: 2 iterations, 1 s each
# Timeout: 10 min per iteration
# Threads: 1 thread, will synchronize iterations
# Benchmark mode: Throughput, ops/time
# Benchmark: com.databricks.unsafe.util.benchmark.UnsafeBenchmark.unsafeTraversalIncrement1
# Parameters: (size = 1048576)
# Run progress: 33.33% complete, ETA 00:00:08
# Fork: 1 of 1
# Warmup Iteration 1: 2045.966 ops/s
# Warmup Iteration 2: 1962.515 ops/s
Iteration 1: 2188.835 ops/s
Iteration 2: 2208.470 ops/s
Run result: 2198.65 ops/s (<= 2 samples)
# JMH 1.6.2 (released 8 days ago)
# VM invoker: /Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home/jre/bin/java
# VM options: -ea
# Warmup: 2 iterations, 1 s each
# Measurement: 2 iterations, 1 s each
# Timeout: 10 min per iteration
# Threads: 1 thread, will synchronize iterations
# Benchmark mode: Throughput, ops/time
# Benchmark: com.databricks.unsafe.util.benchmark.UnsafeBenchmark.unsafeTraversalIncrement8
# Parameters: (size = 1048576)
# Run progress: 66.67% complete, ETA 00:00:04
# Fork: 1 of 1
# Warmup Iteration 1: 1721.352 ops/s
# Warmup Iteration 2: 1796.704 ops/s
Iteration 1: 1857.557 ops/s
Iteration 2: 1802.656 ops/s
Run result: 1830.11 ops/s (<= 2 samples)
# Run complete. Total time: 00:00:12
Benchmark (size) Mode Cnt Score Error Units
UnsafeBenchmark.arrayTraversal 1048576 thrpt 2 2616.060 ± NaN ops/s
UnsafeBenchmark.unsafeTraversalIncrement1 1048576 thrpt 2 2198.652 ± NaN ops/s
UnsafeBenchmark.unsafeTraversalIncrement8 1048576 thrpt 2 1830.106 ± NaN ops/s
# {method} &apos;arrayTraversal&apos; &apos;()J&apos; in &apos;com/databricks/unsafe/util/benchmark/UnsafeBenchmark&apos;
0x000000010a8c9ae0: callq 0x000000010a2165ee ; {runtime_call}
0x000000010a8c9ae5: data32 data32 nopw 0x0(%rax,%rax,1)
0x000000010a8c9af0: mov %eax,-0x14000(%rsp)
0x000000010a8c9af7: push %rbp
0x000000010a8c9af8: sub $0x30,%rsp
0x000000010a8c9afc: mov (%rsi),%r13d
0x000000010a8c9aff: mov 0x18(%rsi),%rbp
0x000000010a8c9b03: mov 0x8(%rsi),%rbx
0x000000010a8c9b07: mov %rsi,%rdi
0x000000010a8c9b0a: movabs $0x10a270578,%r10
0x000000010a8c9b14: callq *%r10
0x000000010a8c9b17: mov 0x8(%rbp),%r10d ; implicit exception: dispatches to 0x000000010a8c9c69
0x000000010a8c9b1b: cmp $0xdf6130ca,%r10d ; {oop(&apos;com/databricks/unsafe/util/benchmark/UnsafeBenchmark&apos;)}
0x000000010a8c9b22: jne 0x000000010a8c9c3d ;*iload_3
; - com.databricks.unsafe.util.benchmark.UnsafeBenchmark::arrayTraversal@4 (line 46)
0x000000010a8c9b28: mov 0xc(%rbp),%edx ;*getfield size
; - com.databricks.unsafe.util.benchmark.UnsafeBenchmark::arrayTraversal@6 (line 46)
0x000000010a8c9b2b: cmp %edx,%r13d
0x000000010a8c9b2e: jge 0x000000010a8c9c0a ;*if_icmpge
; - com.databricks.unsafe.util.benchmark.UnsafeBenchmark::arrayTraversal@9 (line 46)
0x000000010a8c9b34: mov 0x18(%rbp),%r9d ;*getfield longArray
; - com.databricks.unsafe.util.benchmark.UnsafeBenchmark::arrayTraversal@14 (line 47)
0x000000010a8c9b38: mov %r13d,%r11d
0x000000010a8c9b3b: inc %r11d
0x000000010a8c9b3e: lea (%r12,%r9,8),%r10
0x000000010a8c9b42: xor %r8d,%r8d
0x000000010a8c9b45: cmp %r8d,%r11d
0x000000010a8c9b48: cmovl %r8d,%r11d
0x000000010a8c9b4c: cmp %edx,%r11d
0x000000010a8c9b4f: cmovg %edx,%r11d
0x000000010a8c9b53: mov 0xc(%r12,%r9,8),%edi ; implicit exception: dispatches to 0x000000010a8c9c55
0x000000010a8c9b58: cmp %edi,%r13d
0x000000010a8c9b5b: jae 0x000000010a8c9c19 ;*laload
; - com.databricks.unsafe.util.benchmark.UnsafeBenchmark::arrayTraversal@18 (line 47)
0x000000010a8c9b61: add 0x10(%r10,%r13,8),%rbx ;*ladd
; - com.databricks.unsafe.util.benchmark.UnsafeBenchmark::arrayTraversal@19 (line 47)
0x000000010a8c9b66: inc %r13d ;*iinc
; - com.databricks.unsafe.util.benchmark.UnsafeBenchmark::arrayTraversal@21 (line 46)
0x000000010a8c9b69: cmp %r11d,%r13d
0x000000010a8c9b6c: jl 0x000000010a8c9b53 ;*if_icmpge
; - com.databricks.unsafe.util.benchmark.UnsafeBenchmark::arrayTraversal@9 (line 46)
0x000000010a8c9b6e: cmp %edi,%edx
0x000000010a8c9b70: mov %edx,%r8d
0x000000010a8c9b73: cmovg %edi,%r8d
0x000000010a8c9b77: mov %r8d,%esi
0x000000010a8c9b7a: add $0xfffffffffffffff1,%esi
0x000000010a8c9b7d: mov $0x80000000,%ecx
0x000000010a8c9b82: cmp %esi,%r8d
0x000000010a8c9b85: cmovl %ecx,%esi
0x000000010a8c9b88: cmp %esi,%r13d
0x000000010a8c9b8b: jge 0x000000010a8c9bf2
0x000000010a8c9b8d: data32 xchg %ax,%ax ;*laload
; - com.databricks.unsafe.util.benchmark.UnsafeBenchmark::arrayTraversal@18 (line 47)
0x000000010a8c9b90: add 0x10(%r10,%r13,8),%rbx
0x000000010a8c9b95: movslq %r13d,%r11
0x000000010a8c9b98: add 0x18(%r10,%r11,8),%rbx
0x000000010a8c9b9d: add 0x20(%r10,%r11,8),%rbx
0x000000010a8c9ba2: add 0x28(%r10,%r11,8),%rbx
0x000000010a8c9ba7: add 0x30(%r10,%r11,8),%rbx
0x000000010a8c9bac: add 0x38(%r10,%r11,8),%rbx
0x000000010a8c9bb1: add 0x40(%r10,%r11,8),%rbx
0x000000010a8c9bb6: add 0x48(%r10,%r11,8),%rbx
0x000000010a8c9bbb: add 0x50(%r10,%r11,8),%rbx
0x000000010a8c9bc0: add 0x58(%r10,%r11,8),%rbx
0x000000010a8c9bc5: add 0x60(%r10,%r11,8),%rbx
0x000000010a8c9bca: add 0x68(%r10,%r11,8),%rbx
0x000000010a8c9bcf: add 0x70(%r10,%r11,8),%rbx
0x000000010a8c9bd4: add 0x78(%r10,%r11,8),%rbx
0x000000010a8c9bd9: add 0x80(%r10,%r11,8),%rbx
0x000000010a8c9be1: add 0x88(%r10,%r11,8),%rbx ;*ladd
; - com.databricks.unsafe.util.benchmark.UnsafeBenchmark::arrayTraversal@19 (line 47)
0x000000010a8c9be9: add $0x10,%r13d ;*iinc
; - com.databricks.unsafe.util.benchmark.UnsafeBenchmark::arrayTraversal@21 (line 46)
0x000000010a8c9bed: cmp %esi,%r13d
0x000000010a8c9bf0: jl 0x000000010a8c9b90 ;*if_icmpge
; - com.databricks.unsafe.util.benchmark.UnsafeBenchmark::arrayTraversal@9 (line 46)
0x000000010a8c9bf2: cmp %edx,%r13d
0x000000010a8c9bf5: jge 0x000000010a8c9c0a
0x000000010a8c9bf7: nop
0x000000010a8c9bf8: cmp %edi,%r13d
0x000000010a8c9bfb: jae 0x000000010a8c9c1f ;*laload
; - com.databricks.unsafe.util.benchmark.UnsafeBenchmark::arrayTraversal@18 (line 47)
0x000000010a8c9bfd: add 0x10(%r10,%r13,8),%rbx ;*ladd
; - com.databricks.unsafe.util.benchmark.UnsafeBenchmark::arrayTraversal@19 (line 47)
0x000000010a8c9c02: inc %r13d ;*iinc
; - com.databricks.unsafe.util.benchmark.UnsafeBenchmark::arrayTraversal@21 (line 46)
0x000000010a8c9c05: cmp %edx,%r13d
0x000000010a8c9c08: jl 0x000000010a8c9bf8 ;*iload_3
; - com.databricks.unsafe.util.benchmark.UnsafeBenchmark::arrayTraversal@4 (line 46)
0x000000010a8c9c0a: mov %rbx,%rax
0x000000010a8c9c0d: add $0x30,%rsp
0x000000010a8c9c11: pop %rbp
0x000000010a8c9c12: test %eax,-0x1acbc18(%rip) # 0x0000000108dfe000
; {poll_return}
0x000000010a8c9c18: retq
0x000000010a8c9c19: mov %rbx,(%rsp)
0x000000010a8c9c1d: jmp 0x000000010a8c9c23
0x000000010a8c9c1f: mov %rbx,(%rsp)
0x000000010a8c9c23: mov $0xffffffe4,%esi
0x000000010a8c9c28: mov %r9d,0xc(%rsp)
0x000000010a8c9c2d: mov %r13d,0x10(%rsp)
0x000000010a8c9c32: nop
0x000000010a8c9c33: callq 0x000000010a89cf20 ; OopMap{rbp=Oop [12]=NarrowOop off=344}
;*laload
; - com.databricks.unsafe.util.benchmark.UnsafeBenchmark::arrayTraversal@18 (line 47)
; {runtime_call}
0x000000010a8c9c38: callq 0x000000010a2165ee ; {runtime_call}
0x000000010a8c9c3d: mov $0xffffff9d,%esi
0x000000010a8c9c42: mov %rbx,(%rsp)
0x000000010a8c9c46: mov %r13d,0x8(%rsp)
0x000000010a8c9c4b: callq 0x000000010a89cf20 ; OopMap{rbp=Oop off=368}
;*iload_3
; - com.databricks.unsafe.util.benchmark.UnsafeBenchmark::arrayTraversal@4 (line 46)
; {runtime_call}
0x000000010a8c9c50: callq 0x000000010a2165ee ; {runtime_call}
0x000000010a8c9c55: mov $0xfffffff6,%esi
0x000000010a8c9c5a: mov %r13d,%ebp
0x000000010a8c9c5d: xchg %ax,%ax
0x000000010a8c9c5f: callq 0x000000010a89cf20 ; OopMap{off=388}
;*laload
; - com.databricks.unsafe.util.benchmark.UnsafeBenchmark::arrayTraversal@18 (line 47)
; {runtime_call}
0x000000010a8c9c64: callq 0x000000010a2165ee ; {runtime_call}
0x000000010a8c9c69: mov $0xffffff86,%esi
0x000000010a8c9c6e: mov %rbx,%rbp
0x000000010a8c9c71: mov %r13d,(%rsp)
0x000000010a8c9c75: xchg %ax,%ax
0x000000010a8c9c77: callq 0x000000010a89cf20 ; OopMap{off=412}
;*iload_3
; - com.databricks.unsafe.util.benchmark.UnsafeBenchmark::arrayTraversal@4 (line 46)
; {runtime_call}
0x000000010a8c9c7c: callq 0x000000010a2165ee ;*iload_3
; - com.databricks.unsafe.util.benchmark.UnsafeBenchmark::arrayTraversal@4 (line 46)
; {runtime_call}
/*
* Copyright 2014 Databricks
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.databricks.unsafe.util.benchmark;
import org.openjdk.jmh.annotations.*;
import org.openjdk.jmh.runner.Runner;
import org.openjdk.jmh.runner.RunnerException;
import org.openjdk.jmh.runner.options.Options;
import org.openjdk.jmh.runner.options.OptionsBuilder;
import com.databricks.unsafe.util.PlatformDependent;
@State(Scope.Benchmark)
public class UnsafeBenchmark {
@Param({"1048576"})
public int size;
long[] longArray;
long address;
@Setup
public void setup() {
longArray = new long[size];
address = PlatformDependent.UNSAFE.allocateMemory(size * 8);
}
@Benchmark
public long arrayTraversal() {
long sum = 0;
for (int i = 0; i < size; i++) {
sum += longArray[i];
}
return sum;
}
@Benchmark
//@Group("unsafe")
public long unsafeTraversalIncrement1() {
long sum = 0;
int s = size;
final long addr = address;
for (int i = 0; i < s; i++) {
sum += PlatformDependent.UNSAFE.getLong(addr + i * 8);
}
return sum;
}
@Benchmark
//@Group("unsafe")
public long unsafeTraversalIncrement8() {
long sum = 0;
int s = size;
final long end = address + s * 8;
for (long i = address; i < end; i += 8) {
sum += PlatformDependent.UNSAFE.getLong(i);
}
return sum;
}
public static void main(String[] args) throws RunnerException {
Options opt = new OptionsBuilder()
.include(UnsafeBenchmark.class.getSimpleName())
.warmupIterations(5)
.measurementIterations(5)
.forks(2)
.jvmArgs("-ea")
.build();
new Runner(opt).run();
//
// UnsafeBenchmark b = new UnsafeBenchmark();
// b.size = 1048576;
// b.setup();
// long sum = 0;
// for (int i = 0; i < 5000; i++) {
// sum += b.unsafeTraversalIncrement1();
// }
//
// for (int i = 0; i < 5000; i++) {
// sum += b.arrayTraversal();
// }
//
// for (int i = 0; i < 5000; i++) {
// //sum += b.unsafeTraversalIncrement8();
// }
// System.out.println("sum ; " + sum);
}
}
# {method} &apos;unsafeTraversalIncrement1&apos; &apos;()J&apos; in &apos;com/databricks/unsafe/util/benchmark/UnsafeBenchmark&apos;
0x000000010a8c8fa0: callq 0x000000010a2165ee ; {runtime_call}
0x000000010a8c8fa5: data32 data32 nopw 0x0(%rax,%rax,1)
0x000000010a8c8fb0: mov %eax,-0x14000(%rsp)
0x000000010a8c8fb7: push %rbp
0x000000010a8c8fb8: sub $0x50,%rsp
0x000000010a8c8fbc: mov (%rsi),%r14d
0x000000010a8c8fbf: mov 0x18(%rsi),%rbp
0x000000010a8c8fc3: mov 0x8(%rsi),%rbx
0x000000010a8c8fc7: mov %rsi,%rdi
0x000000010a8c8fca: movabs $0x10a270578,%r10
0x000000010a8c8fd4: callq *%r10
0x000000010a8c8fd7: mov 0x8(%rbp),%r11d ; implicit exception: dispatches to 0x000000010a8c9225
0x000000010a8c8fdb: cmp $0xdf6130ca,%r11d ; {oop(&apos;com/databricks/unsafe/util/benchmark/UnsafeBenchmark&apos;)}
0x000000010a8c8fe2: jne 0x000000010a8c920d ;*iload_3
; - com.databricks.unsafe.util.benchmark.UnsafeBenchmark::unsafeTraversalIncrement1@4 (line 103)
0x000000010a8c8fe8: mov 0xc(%rbp),%r11d ;*getfield size
; - com.databricks.unsafe.util.benchmark.UnsafeBenchmark::unsafeTraversalIncrement1@6 (line 103)
0x000000010a8c8fec: cmp $0x7ffffffe,%r11d
0x000000010a8c8ff3: jg 0x000000010a8c91f5
0x000000010a8c8ff9: mov 0x10(%rbp),%rdi
0x000000010a8c8ffd: mov %r14d,%r9d
0x000000010a8c9000: inc %r9d ;*iload_3
; - com.databricks.unsafe.util.benchmark.UnsafeBenchmark::unsafeTraversalIncrement1@4 (line 103)
0x000000010a8c9003: mov %r14d,%r8d
0x000000010a8c9006: shl $0x3,%r8d
0x000000010a8c900a: movslq %r8d,%r10
0x000000010a8c900d: mov %rdi,%r8
0x000000010a8c9010: add %r10,%r8 ;*invokevirtual getLong
; - com.databricks.unsafe.util.benchmark.UnsafeBenchmark::unsafeTraversalIncrement1@26 (line 104)
0x000000010a8c9013: inc %r14d ;*iinc
; - com.databricks.unsafe.util.benchmark.UnsafeBenchmark::unsafeTraversalIncrement1@31 (line 103)
0x000000010a8c9016: cmp %r9d,%r14d
0x000000010a8c9019: jge 0x000000010a8c9020 ;*if_icmpge
; - com.databricks.unsafe.util.benchmark.UnsafeBenchmark::unsafeTraversalIncrement1@9 (line 103)
0x000000010a8c901b: add (%r8),%rbx
0x000000010a8c901e: jmp 0x000000010a8c9003
0x000000010a8c9020: mov %r11d,%r10d
0x000000010a8c9023: inc %r10d
0x000000010a8c9026: add $0xfffffffffffffff2,%r11d
0x000000010a8c902a: mov $0x80000000,%ecx
0x000000010a8c902f: cmp %r11d,%r10d
0x000000010a8c9032: cmovl %ecx,%r11d
0x000000010a8c9036: cmp %r11d,%r14d
0x000000010a8c9039: jge 0x000000010a8c91bf
0x000000010a8c903f: add (%r8),%rbx
0x000000010a8c9042: mov %rbx,%rcx
0x000000010a8c9045: mov %r11d,0x4(%rsp)
0x000000010a8c904a: mov %r10d,0x28(%rsp)
0x000000010a8c904f: jmp 0x000000010a8c9057
0x000000010a8c9051: add (%r8),%rcx ;*ladd
; - com.databricks.unsafe.util.benchmark.UnsafeBenchmark::unsafeTraversalIncrement1@29 (line 104)
0x000000010a8c9054: mov %r11d,%r14d ;*iload_3
; - com.databricks.unsafe.util.benchmark.UnsafeBenchmark::unsafeTraversalIncrement1@4 (line 103)
0x000000010a8c9057: mov %r14d,%r10d
0x000000010a8c905a: mov %r14d,(%rsp)
0x000000010a8c905e: shl $0x3,%r10d ;*imul
; - com.databricks.unsafe.util.benchmark.UnsafeBenchmark::unsafeTraversalIncrement1@23 (line 104)
0x000000010a8c9062: mov %r10d,%r11d
0x000000010a8c9065: add $0x70,%r11d
0x000000010a8c9069: mov %r10d,%r8d
0x000000010a8c906c: add $0x68,%r8d
0x000000010a8c9070: movslq %r11d,%r11
0x000000010a8c9073: mov %r11,0x8(%rsp)
0x000000010a8c9078: movslq %r8d,%r11
0x000000010a8c907b: mov %r11,0x10(%rsp)
0x000000010a8c9080: mov %r10d,%r9d
0x000000010a8c9083: add $0x60,%r9d
0x000000010a8c9087: mov %r10d,%r8d
0x000000010a8c908a: add $0x58,%r8d
0x000000010a8c908e: movslq %r9d,%r11
0x000000010a8c9091: mov %r11,0x18(%rsp)
0x000000010a8c9096: movslq %r8d,%r11
0x000000010a8c9099: mov %r11,0x20(%rsp)
0x000000010a8c909e: mov %r10d,%r11d
0x000000010a8c90a1: add $0x50,%r11d
0x000000010a8c90a5: mov %r10d,%r9d
0x000000010a8c90a8: add $0x48,%r9d
0x000000010a8c90ac: movslq %r11d,%r11
0x000000010a8c90af: mov %r11,0x30(%rsp)
0x000000010a8c90b4: movslq %r9d,%r11
0x000000010a8c90b7: mov %r11,0x38(%rsp)
0x000000010a8c90bc: mov %r10d,%r11d
0x000000010a8c90bf: add $0x40,%r11d
0x000000010a8c90c3: mov %r10d,%r9d
0x000000010a8c90c6: add $0x38,%r9d
0x000000010a8c90ca: movslq %r11d,%rdx
0x000000010a8c90cd: movslq %r9d,%rsi
0x000000010a8c90d0: mov %r10d,%r11d
0x000000010a8c90d3: add $0x30,%r11d
0x000000010a8c90d7: mov %r10d,%r9d
0x000000010a8c90da: add $0x28,%r9d
0x000000010a8c90de: movslq %r11d,%r8
0x000000010a8c90e1: movslq %r9d,%r9
0x000000010a8c90e4: mov %r10d,%r11d
0x000000010a8c90e7: add $0x20,%r11d
0x000000010a8c90eb: mov %r10d,%ebx
0x000000010a8c90ee: add $0x18,%ebx
0x000000010a8c90f1: movslq %r11d,%rax
0x000000010a8c90f4: movslq %ebx,%rbp
0x000000010a8c90f7: mov %r10d,%r11d
0x000000010a8c90fa: add $0x10,%r11d
0x000000010a8c90fe: mov %r10d,%ebx
0x000000010a8c9101: add $0x8,%ebx
0x000000010a8c9104: movslq %r11d,%r13
0x000000010a8c9107: movslq %ebx,%r11
0x000000010a8c910a: movslq %r10d,%rbx
0x000000010a8c910d: mov %rdi,%r14
0x000000010a8c9110: add (%r14,%rbx,1),%rcx
0x000000010a8c9114: mov %rdi,%rbx
0x000000010a8c9117: add (%rbx,%r11,1),%rcx
0x000000010a8c911b: mov %rdi,%r11
0x000000010a8c911e: add (%r11,%r13,1),%rcx
0x000000010a8c9122: mov %rdi,%r11
0x000000010a8c9125: add (%r11,%rbp,1),%rcx
0x000000010a8c9129: mov %rdi,%r11
0x000000010a8c912c: add (%r11,%rax,1),%rcx
0x000000010a8c9130: mov %rdi,%r11
0x000000010a8c9133: add (%r11,%r9,1),%rcx
0x000000010a8c9137: mov %rdi,%r11
0x000000010a8c913a: add (%r11,%r8,1),%rcx
0x000000010a8c913e: mov %rdi,%r11
0x000000010a8c9141: add (%r11,%rsi,1),%rcx
0x000000010a8c9145: mov %rdi,%r11
0x000000010a8c9148: add (%r11,%rdx,1),%rcx
0x000000010a8c914c: mov %rdi,%r11
0x000000010a8c914f: mov 0x38(%rsp),%r8
0x000000010a8c9154: add (%r11,%r8,1),%rcx
0x000000010a8c9158: mov %rdi,%r11
0x000000010a8c915b: mov 0x30(%rsp),%r8
0x000000010a8c9160: add (%r11,%r8,1),%rcx
0x000000010a8c9164: mov %rdi,%r11
0x000000010a8c9167: mov 0x20(%rsp),%r8
0x000000010a8c916c: add (%r11,%r8,1),%rcx
0x000000010a8c9170: mov %rdi,%r11
0x000000010a8c9173: mov 0x18(%rsp),%r8
0x000000010a8c9178: add (%r11,%r8,1),%rcx
0x000000010a8c917c: mov %rdi,%r11
0x000000010a8c917f: mov 0x10(%rsp),%r8
0x000000010a8c9184: add (%r11,%r8,1),%rcx
0x000000010a8c9188: mov %rdi,%r11 ;*invokevirtual getLong
; - com.databricks.unsafe.util.benchmark.UnsafeBenchmark::unsafeTraversalIncrement1@26 (line 104)
0x000000010a8c918b: mov 0x8(%rsp),%r8
0x000000010a8c9190: add (%r11,%r8,1),%rcx ;*ladd
; - com.databricks.unsafe.util.benchmark.UnsafeBenchmark::unsafeTraversalIncrement1@29 (line 104)
0x000000010a8c9194: add $0x78,%r10d
0x000000010a8c9198: movslq %r10d,%r10
0x000000010a8c919b: mov %rdi,%r8
0x000000010a8c919e: add %r10,%r8 ;*invokevirtual getLong
; - com.databricks.unsafe.util.benchmark.UnsafeBenchmark::unsafeTraversalIncrement1@26 (line 104)
0x000000010a8c91a1: mov (%rsp),%r11d
0x000000010a8c91a5: add $0x10,%r11d ;*iinc
; - com.databricks.unsafe.util.benchmark.UnsafeBenchmark::unsafeTraversalIncrement1@31 (line 103)
0x000000010a8c91a9: cmp 0x4(%rsp),%r11d
0x000000010a8c91ae: jl 0x000000010a8c9051 ;*if_icmpge
; - com.databricks.unsafe.util.benchmark.UnsafeBenchmark::unsafeTraversalIncrement1@9 (line 103)
0x000000010a8c91b4: mov %rcx,%rbx
0x000000010a8c91b7: mov %r11d,%r14d
0x000000010a8c91ba: mov 0x28(%rsp),%r10d
0x000000010a8c91bf: cmp %r10d,%r14d
0x000000010a8c91c2: jge 0x000000010a8c91e6
0x000000010a8c91c4: add (%r8),%rbx ;*ladd
; - com.databricks.unsafe.util.benchmark.UnsafeBenchmark::unsafeTraversalIncrement1@29 (line 104)
0x000000010a8c91c7: nop ;*iload_3
; - com.databricks.unsafe.util.benchmark.UnsafeBenchmark::unsafeTraversalIncrement1@4 (line 103)
0x000000010a8c91c8: mov %r14d,%r8d
0x000000010a8c91cb: inc %r8d ;*iinc
; - com.databricks.unsafe.util.benchmark.UnsafeBenchmark::unsafeTraversalIncrement1@31 (line 103)
0x000000010a8c91ce: cmp %r10d,%r8d
0x000000010a8c91d1: jge 0x000000010a8c91e6 ;*if_icmpge
; - com.databricks.unsafe.util.benchmark.UnsafeBenchmark::unsafeTraversalIncrement1@9 (line 103)
0x000000010a8c91d3: shl $0x3,%r14d
0x000000010a8c91d7: movslq %r14d,%r11
0x000000010a8c91da: mov %rdi,%r9 ;*invokevirtual getLong
; - com.databricks.unsafe.util.benchmark.UnsafeBenchmark::unsafeTraversalIncrement1@26 (line 104)
0x000000010a8c91dd: add (%r9,%r11,1),%rbx ;*ladd
; - com.databricks.unsafe.util.benchmark.UnsafeBenchmark::unsafeTraversalIncrement1@29 (line 104)
0x000000010a8c91e1: mov %r8d,%r14d
0x000000010a8c91e4: jmp 0x000000010a8c91c8
0x000000010a8c91e6: mov %rbx,%rax
0x000000010a8c91e9: add $0x50,%rsp
0x000000010a8c91ed: pop %rbp
0x000000010a8c91ee: test %eax,-0x1acb1f4(%rip) # 0x0000000108dfe000
; {poll_return}
0x000000010a8c91f4: retq
0x000000010a8c91f5: mov $0xffffff7e,%esi
0x000000010a8c91fa: mov %rbx,(%rsp)
0x000000010a8c91fe: mov %r14d,0x8(%rsp)
0x000000010a8c9203: callq 0x000000010a89cf20 ; OopMap{rbp=Oop off=616}
;*iload_3
; - com.databricks.unsafe.util.benchmark.UnsafeBenchmark::unsafeTraversalIncrement1@4 (line 103)
; {runtime_call}
0x000000010a8c9208: callq 0x000000010a2165ee ; {runtime_call}
0x000000010a8c920d: mov $0xffffff9d,%esi
0x000000010a8c9212: mov %rbx,(%rsp)
0x000000010a8c9216: mov %r14d,0x8(%rsp)
0x000000010a8c921b: callq 0x000000010a89cf20 ; OopMap{rbp=Oop off=640}
;*iload_3
; - com.databricks.unsafe.util.benchmark.UnsafeBenchmark::unsafeTraversalIncrement1@4 (line 103)
; {runtime_call}
0x000000010a8c9220: callq 0x000000010a2165ee ; {runtime_call}
0x000000010a8c9225: mov $0xffffff86,%esi
0x000000010a8c922a: mov %rbx,%rbp
0x000000010a8c922d: mov %r14d,(%rsp)
0x000000010a8c9231: xchg %ax,%ax
0x000000010a8c9233: callq 0x000000010a89cf20 ; OopMap{off=664}
;*iload_3
; - com.databricks.unsafe.util.benchmark.UnsafeBenchmark::unsafeTraversalIncrement1@4 (line 103)
; {runtime_call}
0x000000010a8c9238: callq 0x000000010a2165ee ;*iload_3
; - com.databricks.unsafe.util.benchmark.UnsafeBenchmark::unsafeTraversalIncrement1@4 (line 103)
; {runtime_call}
0x000000010a8c923d: hlt
0x000000010a8c923e: hlt
0x000000010a8c923f: hlt
[Exception Handler]
[Stub Code]
0x000000010a8c9240: jmpq 0x000000010a8c30a0 ; {no_reloc}
[Deopt Handler Code]
0x000000010a8c9245: callq 0x000000010a8c924a
0x000000010a8c924a: subq $0x5,(%rsp)
0x000000010a8c924f: jmpq 0x000000010a89cb00 ; {runtime_call}
0x000000010a8c9254: hlt
0x000000010a8c9255: hlt
0x000000010a8c9256: hlt
0x000000010a8c9257: hlt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment