package ru.ifmo.nds.jmh;

import java.util.concurrent.TimeUnit;

import org.openjdk.jmh.annotations.*;

import ru.ifmo.nds.IdCollection;
import ru.ifmo.nds.NonDominatedSorting;
import ru.ifmo.nds.rundb.Dataset;

@State(Scope.Benchmark)
@BenchmarkMode(Mode.AverageTime)
@OutputTimeUnit(TimeUnit.MICROSECONDS)
public class JMHBenchmark {
    private NonDominatedSorting sorting;
    private Dataset dataset;

    @Param("Please use ru.ifmo.nds.cli.JMHBenchmark to run this JMH benchmark")
    private String datasetId;

    @Param("Please use ru.ifmo.nds.cli.JMHBenchmark to run this JMH benchmark")
    private String algorithmId;

    @Setup
    public void initializeSorterAndData() {
        dataset = IdCollection.getDataset(datasetId);
        sorting = IdCollection.getNonDominatedSortingFactory(algorithmId)
                .getInstance(dataset.getMaxNumberOfPoints(), dataset.getMaxDimension());
    }

    private int runBenchmark() {
        return dataset.runAlgorithm(sorting, dataset.getMaxNumberOfPoints());
    }

    @TearDown
    public void destroySorter() {
        sorting.close();
    }

    @Benchmark
    public int benchmarkCall() {
        return runBenchmark();
    }
}

@@ -431,35 +431,32 @@
 ru.ifmo.nds.cli.
-JMH
 Benchmark to run
@@ -547,19 +547,16 @@
 nds.cli.
-JMH
 Benchmar

Update description for default params in JMHBenchmark.