use of org.openjdk.jmh.annotations.BenchmarkMode in project druid by druid-io.
the class TopNBenchmark method queryMultiQueryableIndex.
@Benchmark
@BenchmarkMode(Mode.AverageTime)
@OutputTimeUnit(TimeUnit.MICROSECONDS)
public void queryMultiQueryableIndex(Blackhole blackhole) throws Exception {
List<QueryRunner<Result<TopNResultValue>>> singleSegmentRunners = Lists.newArrayList();
QueryToolChest toolChest = factory.getToolchest();
for (int i = 0; i < numSegments; i++) {
String segmentName = "qIndex" + i;
QueryRunner<Result<TopNResultValue>> runner = QueryBenchmarkUtil.makeQueryRunner(factory, segmentName, new QueryableIndexSegment(segmentName, qIndexes.get(i)));
singleSegmentRunners.add(toolChest.preMergeQueryDecoration(runner));
}
QueryRunner theRunner = toolChest.postMergeQueryDecoration(new FinalizeResultsQueryRunner<>(toolChest.mergeResults(factory.mergeRunners(executorService, singleSegmentRunners)), toolChest));
Sequence<Result<TopNResultValue>> queryResult = theRunner.run(query, Maps.<String, Object>newHashMap());
List<Result<TopNResultValue>> results = Sequences.toList(queryResult, Lists.<Result<TopNResultValue>>newArrayList());
for (Result<TopNResultValue> result : results) {
blackhole.consume(result);
}
}
use of org.openjdk.jmh.annotations.BenchmarkMode in project druid by druid-io.
the class BoundFilterBenchmark method matchHalfLexicographic.
@Benchmark
@BenchmarkMode(Mode.AverageTime)
@OutputTimeUnit(TimeUnit.MICROSECONDS)
public void matchHalfLexicographic() {
final ImmutableBitmap bitmapIndex = HALF_LEXICOGRAPHIC.getBitmapIndex(selector);
Preconditions.checkState(bitmapIndex.size() > 0 && bitmapIndex.size() < cardinality);
}
use of org.openjdk.jmh.annotations.BenchmarkMode in project requery by requery.
the class BenchmarkTest method queryJdbc.
@Benchmark
@BenchmarkMode(Mode.SingleShotTime)
public void queryJdbc() throws SQLException {
try (Connection connection = dataSource.getConnection();
PreparedStatement statement = connection.prepareStatement("SELECT id , name , email , birthday," + " age, homepage, uuid FROM Person LIMIT 10000 ")) {
try (ResultSet resultSet = statement.executeQuery()) {
while (resultSet.next()) {
//id
resultSet.getLong(1);
String name = resultSet.getString(2);
String email = resultSet.getString(3);
Date birthday = resultSet.getDate(4);
Integer age = resultSet.getInt(5);
String home = resultSet.getString(6);
byte[] uuid = resultSet.getBytes(7);
Person p = new Person();
p.setName(name);
p.setEmail(email);
p.setUUID(uuid == null ? null : UUID.nameUUIDFromBytes(uuid));
p.setBirthday(birthday);
p.setHomepage(home == null ? null : new URL(home));
p.setAge(age);
}
}
} catch (MalformedURLException e) {
throw new RuntimeException();
}
}
use of org.openjdk.jmh.annotations.BenchmarkMode in project netty by netty.
the class ReadOnlyHttp2HeadersBenchmark method defaultClientHeaders.
@Benchmark
@BenchmarkMode(Mode.AverageTime)
public int defaultClientHeaders() {
Http2Headers headers = new DefaultHttp2Headers(false);
for (int i = 0; i < headerCount; ++i) {
headers.add(headerNames[i], headerValues[i]);
}
headers.method(HttpMethod.POST.asciiName());
headers.scheme(HttpScheme.HTTPS.name());
headers.path(path);
headers.authority(authority);
return iterate(headers);
}
use of org.openjdk.jmh.annotations.BenchmarkMode in project logging-log4j2 by apache.
the class ParameterizedMessageBenchmark method refactoredFormatTo.
@Benchmark
@BenchmarkMode(Mode.SampleTime)
@OutputTimeUnit(TimeUnit.NANOSECONDS)
public int refactoredFormatTo(final ThreadState state) {
state.buffer.setLength(0);
new ParameterizedMessage("pattern {} with {} two parameters and some text", ARGS).formatTo(state.buffer);
return state.buffer.length();
}
Aggregations