mirror of
https://gitlab.uni-marburg.de/langbeid/powersort.git
synced 2025-01-21 19:50:35 +01:00
benchmark: refactor
This commit is contained in:
parent
8e20550b44
commit
a945a3278e
@ -1,9 +1,10 @@
|
||||
package de.uni_marburg.powersort.benchmark;
|
||||
|
||||
import de.uni_marburg.powersort.TimSort;
|
||||
import de.uni_marburg.powersort.sort.DummySort;
|
||||
import de.uni_marburg.powersort.sort.MergeSort;
|
||||
import de.uni_marburg.powersort.sort.TimSort;
|
||||
import de.uni_marburg.powersort.data.RandomIntegers;
|
||||
import org.openjdk.jmh.annotations.*;
|
||||
import org.openjdk.jmh.infra.Blackhole;
|
||||
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
@ -28,16 +29,15 @@ public class BenchmarkJmh {
|
||||
@BenchmarkMode(Mode.AverageTime)
|
||||
@OutputTimeUnit(TimeUnit.MILLISECONDS)
|
||||
@Benchmark
|
||||
public void rand1DummySort(State1 s, Blackhole bh) {
|
||||
public void rand1DummySort(State1 s) {
|
||||
DummySort.sort(s.a, 0, s.a.length, NaturalOrder.INSTANCE, null, 0, 0);
|
||||
}
|
||||
|
||||
@BenchmarkMode(Mode.AverageTime)
|
||||
@OutputTimeUnit(TimeUnit.MILLISECONDS)
|
||||
@Benchmark
|
||||
public void rand1TimSort(State1 s, Blackhole bh) {
|
||||
public void rand1TimSort(State1 s) {
|
||||
TimSort.sort(s.a, 0, s.a.length, NaturalOrder.INSTANCE, null, 0, 0);
|
||||
bh.consume(s);
|
||||
}
|
||||
|
||||
@BenchmarkMode(Mode.AverageTime)
|
||||
|
@ -1,6 +1,8 @@
|
||||
package de.uni_marburg.powersort.benchmark;
|
||||
|
||||
import de.uni_marburg.powersort.TimSort;
|
||||
import de.uni_marburg.powersort.sort.DummySort;
|
||||
import de.uni_marburg.powersort.sort.MergeSort;
|
||||
import de.uni_marburg.powersort.sort.TimSort;
|
||||
import de.uni_marburg.powersort.data.DescendingIntegers;
|
||||
import de.uni_marburg.powersort.data.RandomIntegers;
|
||||
import de.uni_marburg.powersort.data.ObjectSupplier;
|
||||
|
@ -24,7 +24,7 @@
|
||||
* questions.
|
||||
*/
|
||||
|
||||
package de.uni_marburg.powersort;
|
||||
package de.uni_marburg.powersort.sort;
|
||||
|
||||
/**
|
||||
* This is a near duplicate of {@link TimSort}, modified for use with
|
@ -1,4 +1,4 @@
|
||||
package de.uni_marburg.powersort.benchmark;
|
||||
package de.uni_marburg.powersort.sort;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Comparator;
|
||||
@ -8,7 +8,7 @@ import java.util.Comparator;
|
||||
* <p>
|
||||
* Uses Arrays.sort() for sorting.
|
||||
*/
|
||||
class DummySort {
|
||||
public class DummySort {
|
||||
public static <T> void sort(T[] a, int lo, int hi, Comparator<? super T> c,
|
||||
T[] work, int workBase, int workLen) {
|
||||
assert lo == 0;
|
@ -1,4 +1,4 @@
|
||||
package de.uni_marburg.powersort.benchmark;
|
||||
package de.uni_marburg.powersort.sort;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Comparator;
|
@ -1,4 +1,4 @@
|
||||
package de.uni_marburg.powersort.benchmark;
|
||||
package de.uni_marburg.powersort.sort;
|
||||
|
||||
import java.util.Comparator;
|
||||
|
@ -1,4 +1,4 @@
|
||||
package de.uni_marburg.powersort;
|
||||
package de.uni_marburg.powersort.sort;
|
||||
|
||||
import java.util.Comparator;
|
||||
|
@ -24,7 +24,7 @@
|
||||
* questions.
|
||||
*/
|
||||
|
||||
package de.uni_marburg.powersort;
|
||||
package de.uni_marburg.powersort.sort;
|
||||
|
||||
import java.util.Comparator;
|
||||
|
Loading…
x
Reference in New Issue
Block a user