Moved Benchmarking intro to "Verifying"
This commit is contained in:
parent
b0b9fa3499
commit
6b1dcd12bc
@ -1,4 +1,4 @@
|
|||||||
// arrays/BadMicroBenchmark.java
|
// verifying/BadMicroBenchmark.java
|
||||||
// (c)2016 MindView LLC: see Copyright.txt
|
// (c)2016 MindView LLC: see Copyright.txt
|
||||||
// We make no guarantees that this code is fit for any purpose.
|
// We make no guarantees that this code is fit for any purpose.
|
||||||
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
|
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
|
@ -1,4 +1,4 @@
|
|||||||
// arrays/BadMicroBenchmark2.java
|
// verifying/BadMicroBenchmark2.java
|
||||||
// (c)2016 MindView LLC: see Copyright.txt
|
// (c)2016 MindView LLC: see Copyright.txt
|
||||||
// We make no guarantees that this code is fit for any purpose.
|
// We make no guarantees that this code is fit for any purpose.
|
||||||
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
|
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
|
@ -1,4 +1,4 @@
|
|||||||
// arrays/BadMicroBenchmark3.java
|
// verifying/BadMicroBenchmark3.java
|
||||||
// (c)2016 MindView LLC: see Copyright.txt
|
// (c)2016 MindView LLC: see Copyright.txt
|
||||||
// We make no guarantees that this code is fit for any purpose.
|
// We make no guarantees that this code is fit for any purpose.
|
||||||
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
|
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
|
24
verifying/jmhtests/ParallelSetAll.java
Normal file
24
verifying/jmhtests/ParallelSetAll.java
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
// verifying/jmhtests/ParallelSetAll.java
|
||||||
|
// (c)2016 MindView LLC: see Copyright.txt
|
||||||
|
// We make no guarantees that this code is fit for any purpose.
|
||||||
|
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
|
||||||
|
package verifying.jmhtests;
|
||||||
|
import java.util.*;
|
||||||
|
import org.openjdk.jmh.annotations.*;
|
||||||
|
|
||||||
|
@State(Scope.Thread)
|
||||||
|
public class ParallelSetAll {
|
||||||
|
private long[] la;
|
||||||
|
@Setup
|
||||||
|
public void setup() {
|
||||||
|
la = new long[20_000_000];
|
||||||
|
}
|
||||||
|
@Benchmark
|
||||||
|
public void setAll() {
|
||||||
|
Arrays.setAll(la, n -> n);
|
||||||
|
}
|
||||||
|
@Benchmark
|
||||||
|
public void parallelSetAll() {
|
||||||
|
Arrays.parallelSetAll(la, n -> n);
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user