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();
}
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;
}
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;
}
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;
}
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();
}
Aggregations