Class ArrayShuffleBenchmark
- java.lang.Object
-
- org.apache.commons.rng.examples.jmh.sampling.ArrayShuffleBenchmark
-
public class ArrayShuffleBenchmark extends Object
Executes benchmark to compare the speed of shuffling an array.Batched shuffle samples have been adapted from the blog post: Daniel Lemire: Faster random integer generation with batching. The samples provided in the blog and the referenced paper are for a 64-bit source of randomness which requires native support for 128-bit multiplication. These have been modified for a 32-bit source of randomness.
- Nevin Brackett-Rozinsky, Daniel Lemire, Batched Ranged Random Integer Generation, Software: Practice and Experience (to appear) arXiv:2408.06213M
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classArrayShuffleBenchmark.RngSourceDefines theRandomSourcefor testing.static classArrayShuffleBenchmark.ShuffleDataThe data for the shuffle.static classArrayShuffleBenchmark.ShuffleMethodDefines the shuffle method.
-
Constructor Summary
Constructors Constructor Description ArrayShuffleBenchmark()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Objectshuffle(ArrayShuffleBenchmark.ShuffleData data, ArrayShuffleBenchmark.RngSource source, ArrayShuffleBenchmark.ShuffleMethod method)Performs a shuffle.
-
-
-
Constructor Detail
-
ArrayShuffleBenchmark
public ArrayShuffleBenchmark()
-
-
Method Detail
-
shuffle
public Object shuffle(ArrayShuffleBenchmark.ShuffleData data, ArrayShuffleBenchmark.RngSource source, ArrayShuffleBenchmark.ShuffleMethod method)
Performs a shuffle.- Parameters:
data- Shuffle data.source- Source of randomness.method- Shuffle method.- Returns:
- the shuffled data
-
-