1
1
/*
2
- * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
2
+ * Copyright (c) 2020, 2021, Oracle and/or its affiliates. All rights reserved.
3
3
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4
4
*
5
5
* This code is free software; you can redistribute it and/or modify it
43
43
import java .nio .IntBuffer ;
44
44
import java .util .concurrent .TimeUnit ;
45
45
46
- import static jdk .incubator .foreign .ValueLayout .JAVA_BYTE ;
47
46
import static jdk .incubator .foreign .ValueLayout .JAVA_INT ;
48
47
49
48
@ BenchmarkMode (Mode .AverageTime )
@@ -138,20 +137,20 @@ public void segment_copy() {
138
137
@ Benchmark
139
138
@ OutputTimeUnit (TimeUnit .NANOSECONDS )
140
139
public void segment_copy_static () {
141
- MemorySegment .copy (bytes , 0 , segment , JAVA_BYTE , 0 , bytes .length );
140
+ MemorySegment .copy (bytes , 0 , segment , JAVA_INT , 0 , bytes .length );
142
141
}
143
142
144
143
@ Benchmark
145
144
@ OutputTimeUnit (TimeUnit .NANOSECONDS )
146
145
public void segment_copy_static_small () {
147
- MemorySegment .copy (bytes , 0 , segment , JAVA_BYTE , 0 , 10 );
146
+ MemorySegment .copy (bytes , 0 , segment , JAVA_INT , 0 , 10 );
148
147
}
149
148
150
149
@ Benchmark
151
150
@ CompilerControl (CompilerControl .Mode .DONT_INLINE )
152
151
@ OutputTimeUnit (TimeUnit .NANOSECONDS )
153
152
public void segment_copy_static_small_dontinline () {
154
- MemorySegment .copy (bytes , 0 , segment , JAVA_BYTE , 0 , 10 );
153
+ MemorySegment .copy (bytes , 0 , segment , JAVA_INT , 0 , 10 );
155
154
}
156
155
157
156
@ Benchmark
@@ -176,7 +175,7 @@ public void buffer_copy() {
176
175
@ CompilerControl (CompilerControl .Mode .DONT_INLINE )
177
176
@ OutputTimeUnit (TimeUnit .NANOSECONDS )
178
177
public void segment_copy_static_dontinline () {
179
- MemorySegment .copy (bytes , 0 , segment , JAVA_BYTE , 0 , bytes .length );
178
+ MemorySegment .copy (bytes , 0 , segment , JAVA_INT , 0 , bytes .length );
180
179
}
181
180
182
181
@ Benchmark
0 commit comments