Refine search
@State(Scope.Benchmark) public class ConciseComplementBenchmark { // Number of rows to read, the test will read random rows @Param({"1000", "10000", "100000", "1000000", "1000000"}) int emptyRows; @Benchmark @BenchmarkMode(Mode.AverageTime) @OutputTimeUnit(TimeUnit.MICROSECONDS) public void uncompressed(Blackhole blackhole) { final ImmutableConciseSet set = ImmutableConciseSet.complement(null, emptyRows); blackhole.consume(set); assert (emptyRows == set.size()); } }
@State(Scope.Benchmark) public static class BitmapsForIntersection { /** * Number of bitmaps to intersect. */ @Param({"2", "10", "100"}) public int n; private ImmutableBitmap[] bitmaps; @Setup public void setup(BitmapIterationBenchmark state) { // prob of intersection = product (probs of intersected bitmaps), prob = intersectedBitmapProb ^ n double intersectedBitmapProb = Math.pow(state.prob, 1.0 / n); bitmaps = new ImmutableBitmap[n]; for (int i = 0; i < n; i++) { bitmaps[i] = state.makeBitmap(intersectedBitmapProb); } } }
@State(Scope.Benchmark) public class RealDataBenchmarkState extends org.roaringbitmap.AbstractBenchmarkState { @Param({// putting the data sets in alpha. order CENSUS_INCOME}) public String dataset; @Param({ROARING_WITH_RUN}) public String type; @Param({"false",}) public boolean immutable; public RealDataBenchmarkState() {} @Setup public void setup() throws Exception { super.setup(dataset, type, immutable); } }
@State(Scope.Benchmark) public class RealDataBenchmarkState extends org.roaringbitmap.AbstractBenchmarkState { @Param({// putting the data sets in alpha. order CENSUS_INCOME}) public String dataset; @Param({ROARING}) public String type; @Param({"false",}) public boolean immutable; public RealDataBenchmarkState() {} @Setup public void setup() throws Exception { super.setup(dataset, type, immutable); } }
@State(Scope.Benchmark) public class RealDataBenchmarkState extends org.roaringbitmap.AbstractBenchmarkState { @Param({// putting the data sets in alpha. order CENSUS_INCOME, CENSUS1881, DIMENSION_008, DIMENSION_003, DIMENSION_033, USCENSUS2000, WEATHER_SEPT_85, WIKILEAKS_NOQUOTES, CENSUS_INCOME_SRT, CENSUS1881_SRT, WEATHER_SEPT_85_SRT, WIKILEAKS_NOQUOTES_SRT}) public String dataset; @Param({CONCISE, WAH, EWAH, EWAH32, ROARING, ROARING_WITH_RUN}) public String type; @Param({"false", "true"}) public boolean immutable; public RealDataBenchmarkState() {} @Setup public void setup() throws Exception { super.setup(dataset, type, immutable); } }
@State(Scope.Benchmark) public class NeedWorkBenchmarkState extends AbstractBenchmarkState { @Param({// putting the data sets in alpha. order CENSUS_INCOME, CENSUS1881, DIMENSION_008, DIMENSION_003, DIMENSION_033, USCENSUS2000, WEATHER_SEPT_85, WIKILEAKS_NOQUOTES, CENSUS_INCOME_SRT, CENSUS1881_SRT, WEATHER_SEPT_85_SRT, WIKILEAKS_NOQUOTES_SRT}) public String dataset; @Param({ROARING, ROARING_WITH_RUN}) public String type; @Param({"false", "true"}) public boolean immutable; public NeedWorkBenchmarkState() {} @Setup public void setup() throws Exception { super.setup(dataset, type, immutable); } }
@State(Scope.Benchmark) public class RealDataRoaringOnlyBenchmarkState extends org.roaringbitmap.RoaringOnlyBenchmarkState { @Param({// putting the data sets in alpha. order CENSUS_INCOME, CENSUS1881, DIMENSION_008, DIMENSION_003, DIMENSION_033, USCENSUS2000, WEATHER_SEPT_85, WIKILEAKS_NOQUOTES, CENSUS_INCOME_SRT, CENSUS1881_SRT, WEATHER_SEPT_85_SRT, WIKILEAKS_NOQUOTES_SRT}) public String dataset; public RealDataRoaringOnlyBenchmarkState() {} @Setup public void setup() throws Exception { super.setup(dataset); } }
@State(Thread) public static class PagesIndexSortBenchmarkData extends BaseBenchmarkData { @Param("1") private int numSortChannels = 1; @Param({"1", "8"}) private int totalChannels = 1; @Param({"200", "400"}) private int pagesCount = 200; @Setup public void setup() { super.setup(numSortChannels, totalChannels, 1, pagesCount); } }
@State(Thread) public static class MergeSortedBenchmarkData extends BaseBenchmarkData { @Param("1") private int numSortChannels = 1; @Param({"1", "8"}) private int totalChannels = 1; @Param({"2", "16"}) private int numMergeSources = 2; @Param({"200", "400"}) private int pagesCount = 200; @Setup public void setup() { super.setup(numSortChannels, totalChannels, numMergeSources, pagesCount); } }
@SuppressWarnings("FieldMayBeFinal") @State(Scope.Thread) public static class BaselinePagesData { @Param("1") private int channelCount = 1; @Param("false") private boolean hashEnabled; @Param(GROUP_COUNT_STRING) private int groupCount; private List<Page> pages; @Setup public void setup() { pages = createBigintPages(POSITIONS, groupCount, channelCount, hashEnabled); } public List<Page> getPages() { return pages; } }
@State(Thread) public static class CastDecimalToDoubleBenchmarkState extends BaseState { private static final int SCALE = 10; @Param({"15", "35"}) private String precision = "15"; @Setup public void setup() { addSymbol("v1", createDecimalType(Integer.valueOf(precision), SCALE)); String expression = "CAST(v1 AS DOUBLE)"; generateRandomInputPage(); generateProcessor(expression); } }
@State(Thread) public static class CastDecimalToVarcharBenchmarkState extends BaseState { private static final int SCALE = 10; @Param({"15", "35"}) private String precision = "35"; @Setup public void setup() { addSymbol("v1", createDecimalType(Integer.valueOf(precision), SCALE)); String expression = "CAST(v1 AS VARCHAR)"; generateRandomInputPage(); generateProcessor(expression); } }
@SuppressWarnings("FieldMayBeFinal") @State(Scope.Thread) public static class BenchmarkData { private final long[] buffer = new long[256]; private final LongBitPacker packer = new LongBitPacker(); @Param({"1", "2", "4", "8", "16", "24", "32", "40", "48", "56", "64"}) private int bits; private BasicSliceInput input; @Setup public void setup() { byte[] bytes = new byte[256 * 64]; ThreadLocalRandom.current().nextBytes(bytes); input = Slices.wrappedBuffer(bytes).getInput(); } }
@State(Scope.Thread) public static class BenchmarkData { private final List<Type> types = ImmutableList.of(DOUBLE, DOUBLE, VARCHAR, DOUBLE); private final PageWithPositionComparator comparator = new SimplePageWithPositionComparator( types, ImmutableList.of(0, 2), ImmutableList.of(DESC_NULLS_LAST, ASC_NULLS_FIRST)); @Param({"1", "100", "10000", "1000000"}) private String topN = "1"; @Param({"1", "100", "10000", "1000000"}) private String positions = "1"; private Page page; private GroupedTopNBuilder topNBuilder; @Setup public void setup() { page = createInputPage(Integer.valueOf(positions), types); topNBuilder = new GroupedTopNBuilder(types, comparator, Integer.valueOf(topN), false, new NoChannelGroupByHash()); } public GroupedTopNBuilder getTopNBuilder() { return topNBuilder; } public Page getPage() { return page; } }
@State(Thread) public static class AggregationContext { @Param({"orderstatus, avg(totalprice)", "orderstatus, min(totalprice)", "orderstatus, sum(totalprice), avg(totalprice), min(totalprice), max(totalprice)"}) private String project; @Param({"double", "decimal(14,2)", "decimal(30,10)"}) private String type; private MemoryLocalQueryRunner queryRunner; public final MemoryLocalQueryRunner getQueryRunner() { return queryRunner; } @Setup public void setUp() { queryRunner = new MemoryLocalQueryRunner(); queryRunner.execute(format( "CREATE TABLE memory.default.orders AS SELECT orderstatus, cast(totalprice as %s) totalprice FROM tpch.sf1.orders", type)); } @TearDown public void tearDown() { queryRunner.close(); queryRunner = null; } }
@State(Thread) public static class DecimalToShortDecimalCastBenchmarkState extends BaseState { @Param({"cast(l_38_30 as decimal(8, 0))", "cast(l_26_18 as decimal(8, 0))", "cast(l_20_12 as decimal(8, 0))", "cast(l_20_8 as decimal(8, 0))", "cast(s_17_9 as decimal(8, 0))"}) private String expression = "cast(l_38_30 as decimal(8, 0))"; @Setup public void setup() { addSymbol("l_38_30", createDecimalType(38, 30)); addSymbol("l_26_18", createDecimalType(26, 18)); addSymbol("l_20_12", createDecimalType(20, 12)); addSymbol("l_20_8", createDecimalType(20, 8)); addSymbol("s_17_9", createDecimalType(17, 9)); generateInputPage(10000, 10000, 10000, 10000, 10000); generateProcessor(expression); } }