Search in sources :

Example 41 with Benchmark

use of org.openjdk.jmh.annotations.Benchmark in project presto by prestodb.

the class PageProcessorBenchmark method rowOriented.

@Benchmark
public Page rowOriented() {
    PageBuilder pageBuilder = new PageBuilder(types);
    int end = processor.process(null, inputPage, 0, inputPage.getPositionCount(), pageBuilder);
    return pageBuilder.build();
}
Also used : SequencePageBuilder(com.facebook.presto.SequencePageBuilder) PageBuilder(com.facebook.presto.spi.PageBuilder) Benchmark(org.openjdk.jmh.annotations.Benchmark)

Example 42 with Benchmark

use of org.openjdk.jmh.annotations.Benchmark in project presto by prestodb.

the class BenchmarkOrcDecimalReader method readDecimal.

@Benchmark
public Object readDecimal(BenchmarkData data) throws Throwable {
    OrcRecordReader recordReader = data.createRecordReader();
    List<Block> blocks = new ArrayList<>();
    while (recordReader.nextBatch() > 0) {
        Block block = recordReader.readBlock(DECIMAL_TYPE, 0);
        blocks.add(block);
    }
    return blocks;
}
Also used : ArrayList(java.util.ArrayList) Block(com.facebook.presto.spi.block.Block) Benchmark(org.openjdk.jmh.annotations.Benchmark)

Example 43 with Benchmark

use of org.openjdk.jmh.annotations.Benchmark in project presto by prestodb.

the class BenchmarkPagesIndexPageSorter method runBenchmark.

@Benchmark
public int runBenchmark(BenchmarkData data) {
    PageSorter pageSorter = new PagesIndexPageSorter(new PagesIndex.TestingFactory());
    long[] addresses = pageSorter.sort(data.types, data.pages, data.sortChannels, nCopies(data.sortChannels.size(), ASC_NULLS_FIRST), 10_000);
    return addresses.length;
}
Also used : PageSorter(com.facebook.presto.spi.PageSorter) PagesIndex(com.facebook.presto.operator.PagesIndex) Benchmark(org.openjdk.jmh.annotations.Benchmark)

Example 44 with Benchmark

use of org.openjdk.jmh.annotations.Benchmark in project presto by prestodb.

the class BenchmarkNodeScheduler method benchmark.

@Benchmark
@OperationsPerInvocation(SPLITS)
public Object benchmark(BenchmarkData data) throws Throwable {
    List<RemoteTask> remoteTasks = ImmutableList.copyOf(data.getTaskMap().values());
    Iterator<MockRemoteTaskFactory.MockRemoteTask> finishingTask = Iterators.cycle(data.getTaskMap().values());
    Iterator<Split> splits = data.getSplits().iterator();
    Set<Split> batch = new HashSet<>();
    while (splits.hasNext() || !batch.isEmpty()) {
        Multimap<Node, Split> assignments = data.getNodeSelector().computeAssignments(batch, remoteTasks).getAssignments();
        for (Node node : assignments.keySet()) {
            MockRemoteTaskFactory.MockRemoteTask remoteTask = data.getTaskMap().get(node);
            remoteTask.addSplits(ImmutableMultimap.<PlanNodeId, Split>builder().putAll(new PlanNodeId("sourceId"), assignments.get(node)).build());
            remoteTask.startSplits(MAX_SPLITS_PER_NODE);
        }
        if (assignments.size() == batch.size()) {
            batch.clear();
        } else {
            batch.removeAll(assignments.values());
        }
        while (batch.size() < SPLIT_BATCH_SIZE && splits.hasNext()) {
            batch.add(splits.next());
        }
        finishingTask.next().finishSplits((int) Math.ceil(MAX_SPLITS_PER_NODE / 50.0));
    }
    return remoteTasks;
}
Also used : Node(com.facebook.presto.spi.Node) PrestoNode(com.facebook.presto.metadata.PrestoNode) PlanNodeId(com.facebook.presto.sql.planner.plan.PlanNodeId) ConnectorSplit(com.facebook.presto.spi.ConnectorSplit) Split(com.facebook.presto.metadata.Split) HashSet(java.util.HashSet) Benchmark(org.openjdk.jmh.annotations.Benchmark) OperationsPerInvocation(org.openjdk.jmh.annotations.OperationsPerInvocation)

Example 45 with Benchmark

use of org.openjdk.jmh.annotations.Benchmark in project presto by prestodb.

the class BenchmarkGroupByHash method bigintGroupByHash.

@Benchmark
@OperationsPerInvocation(POSITIONS)
public Object bigintGroupByHash(SingleChannelBenchmarkData data) {
    GroupByHash groupByHash = new BigintGroupByHash(0, data.getHashEnabled(), EXPECTED_SIZE);
    data.getPages().forEach(groupByHash::addPage);
    ImmutableList.Builder<Page> pages = ImmutableList.builder();
    PageBuilder pageBuilder = new PageBuilder(groupByHash.getTypes());
    for (int groupId = 0; groupId < groupByHash.getGroupCount(); groupId++) {
        pageBuilder.declarePosition();
        groupByHash.appendValuesTo(groupId, pageBuilder, 0);
        if (pageBuilder.isFull()) {
            pages.add(pageBuilder.build());
            pageBuilder.reset();
        }
    }
    pages.add(pageBuilder.build());
    return pageBuilder.build();
}
Also used : ImmutableList(com.google.common.collect.ImmutableList) Page(com.facebook.presto.spi.Page) PageBuilder(com.facebook.presto.spi.PageBuilder) Benchmark(org.openjdk.jmh.annotations.Benchmark) OperationsPerInvocation(org.openjdk.jmh.annotations.OperationsPerInvocation)

Aggregations

Benchmark (org.openjdk.jmh.annotations.Benchmark)142 BenchmarkMode (org.openjdk.jmh.annotations.BenchmarkMode)96 OutputTimeUnit (org.openjdk.jmh.annotations.OutputTimeUnit)93 QueryableIndexSegment (io.druid.segment.QueryableIndexSegment)37 Result (io.druid.query.Result)27 InputRow (io.druid.data.input.InputRow)25 Row (io.druid.data.input.Row)21 ArrayList (java.util.ArrayList)17 TopNResultValue (io.druid.query.topn.TopNResultValue)15 Cursor (io.druid.segment.Cursor)15 ImmutableBitmap (io.druid.collections.bitmap.ImmutableBitmap)13 QueryableIndexStorageAdapter (io.druid.segment.QueryableIndexStorageAdapter)13 StorageAdapter (io.druid.segment.StorageAdapter)13 List (java.util.List)13 BoundDimFilter (io.druid.query.filter.BoundDimFilter)9 DimFilter (io.druid.query.filter.DimFilter)9 OperationsPerInvocation (org.openjdk.jmh.annotations.OperationsPerInvocation)9 Page (com.facebook.presto.spi.Page)8 OrDimFilter (io.druid.query.filter.OrDimFilter)8 SelectorDimFilter (io.druid.query.filter.SelectorDimFilter)8