use of org.openjdk.jmh.annotations.Threads in project apm-agent-java by elastic.
the class ObjectPoolBenchmark method testRingBufferObjectPool.
@Benchmark
@Threads(8)
public Transaction testRingBufferObjectPool() {
Transaction transaction = ringBufferObjectPool.createInstance();
ringBufferObjectPool.recycle(transaction);
return transaction;
}
use of org.openjdk.jmh.annotations.Threads in project apm-agent-java by elastic.
the class ObjectPoolBenchmark method testBlockingQueueObjectPool.
// @Benchmark
@Threads(8)
public Transaction testBlockingQueueObjectPool() {
Transaction transaction = blockingQueueObjectPool.createInstance();
blockingQueueObjectPool.recycle(transaction);
return transaction;
}
use of org.openjdk.jmh.annotations.Threads in project atlasdb by palantir.
the class KvsGetRowsColumnRangeBenchmarks method getAllColumnsAligned.
@Benchmark
@Threads(1)
@Warmup(time = 16, timeUnit = TimeUnit.SECONDS)
@Measurement(time = 160, timeUnit = TimeUnit.SECONDS)
public Object getAllColumnsAligned(WideRowsTable table) {
List<byte[]> rows = IntStream.rangeClosed(0, WideRowsTable.NUM_ROWS - 1).mapToObj(WideRowsTable::getRow).collect(Collectors.toList());
RowColumnRangeIterator rowsColumnRange = table.getKvs().getRowsColumnRange(table.getTableRef(), rows, new ColumnRangeSelection(null, null), 10000, Long.MAX_VALUE);
int expectedNumCells = WideRowsTable.NUM_ROWS * WideRowsTable.NUM_COLS_PER_ROW;
List<Map.Entry<Cell, Value>> loadedCells = new ArrayList<>(expectedNumCells);
while (rowsColumnRange.hasNext()) {
loadedCells.add(rowsColumnRange.next());
}
Preconditions.checkState(loadedCells.size() == expectedNumCells, "Should be %s cells, but were: %s", expectedNumCells, loadedCells.size());
return loadedCells;
}
use of org.openjdk.jmh.annotations.Threads in project atlasdb by palantir.
the class KvsGetRowsColumnRangeBenchmarks method getAllColumnsSingleBigRow.
@Benchmark
@Threads(1)
@Warmup(time = 16, timeUnit = TimeUnit.SECONDS)
@Measurement(time = 160, timeUnit = TimeUnit.SECONDS)
public Object getAllColumnsSingleBigRow(VeryWideRowTable table, Blackhole blackhole) {
RowColumnRangeIterator iter = table.getKvs().getRowsColumnRange(table.getTableRef(), Collections.singleton(Tables.ROW_BYTES.array()), new ColumnRangeSelection(null, null), 10000, Long.MAX_VALUE);
int count = 0;
while (iter.hasNext()) {
blackhole.consume(iter.next());
++count;
}
Preconditions.checkState(count == table.getNumCols(), "Should be %s cells, but were: %s", table.getNumCols(), count);
return count;
}
use of org.openjdk.jmh.annotations.Threads in project atlasdb by palantir.
the class StreamStoreBenchmarks method loadLargeStream.
@Benchmark
@Threads(1)
@Warmup(time = 1, timeUnit = TimeUnit.SECONDS)
@Measurement(time = 30, timeUnit = TimeUnit.SECONDS)
public void loadLargeStream(StreamingTable table) throws IOException {
long id = table.getLargeStreamId();
TransactionManager transactionManager = table.getTransactionManager();
StreamTestTableFactory tables = StreamTestTableFactory.of();
ValueStreamStore store = ValueStreamStore.of(transactionManager, tables);
try (InputStream inputStream = transactionManager.runTaskThrowOnConflict(txn -> store.loadStream(txn, id))) {
byte[] firstBytes = new byte[16];
int read = inputStream.read(firstBytes);
assertThat(read, is(16));
assertArrayEquals(table.getLargeStreamFirstBytes(), firstBytes);
}
}
Aggregations