Search in sources :

Example 11 with Threads

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;
}
Also used : Transaction(co.elastic.apm.impl.transaction.Transaction) Threads(org.openjdk.jmh.annotations.Threads) Benchmark(org.openjdk.jmh.annotations.Benchmark)

Example 12 with Threads

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;
}
Also used : Transaction(co.elastic.apm.impl.transaction.Transaction) Threads(org.openjdk.jmh.annotations.Threads)

Example 13 with Threads

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;
}
Also used : ArrayList(java.util.ArrayList) RowColumnRangeIterator(com.palantir.atlasdb.keyvalue.api.RowColumnRangeIterator) ColumnRangeSelection(com.palantir.atlasdb.keyvalue.api.ColumnRangeSelection) Threads(org.openjdk.jmh.annotations.Threads) Measurement(org.openjdk.jmh.annotations.Measurement) Warmup(org.openjdk.jmh.annotations.Warmup) Benchmark(org.openjdk.jmh.annotations.Benchmark)

Example 14 with Threads

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;
}
Also used : RowColumnRangeIterator(com.palantir.atlasdb.keyvalue.api.RowColumnRangeIterator) ColumnRangeSelection(com.palantir.atlasdb.keyvalue.api.ColumnRangeSelection) Threads(org.openjdk.jmh.annotations.Threads) Measurement(org.openjdk.jmh.annotations.Measurement) Warmup(org.openjdk.jmh.annotations.Warmup) Benchmark(org.openjdk.jmh.annotations.Benchmark)

Example 15 with Threads

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);
    }
}
Also used : TransactionManager(com.palantir.atlasdb.transaction.api.TransactionManager) InputStream(java.io.InputStream) StreamTestTableFactory(com.palantir.atlasdb.performance.schema.generated.StreamTestTableFactory) ValueStreamStore(com.palantir.atlasdb.performance.schema.generated.ValueStreamStore) Threads(org.openjdk.jmh.annotations.Threads) Measurement(org.openjdk.jmh.annotations.Measurement) Warmup(org.openjdk.jmh.annotations.Warmup) Benchmark(org.openjdk.jmh.annotations.Benchmark)

Aggregations

Threads (org.openjdk.jmh.annotations.Threads)17 Benchmark (org.openjdk.jmh.annotations.Benchmark)15 Measurement (org.openjdk.jmh.annotations.Measurement)8 Warmup (org.openjdk.jmh.annotations.Warmup)8 DirectBuffer (org.agrona.DirectBuffer)5 Transaction (co.elastic.apm.impl.transaction.Transaction)4 ColumnRangeSelection (com.palantir.atlasdb.keyvalue.api.ColumnRangeSelection)4 TaskEvent (io.zeebe.broker.taskqueue.data.TaskEvent)4 MutableDirectBuffer (org.agrona.MutableDirectBuffer)4 RowColumnRangeIterator (com.palantir.atlasdb.keyvalue.api.RowColumnRangeIterator)3 StreamTestTableFactory (com.palantir.atlasdb.performance.schema.generated.StreamTestTableFactory)3 ValueStreamStore (com.palantir.atlasdb.performance.schema.generated.ValueStreamStore)3 TransactionManager (com.palantir.atlasdb.transaction.api.TransactionManager)3 InputStream (java.io.InputStream)3 ArrayList (java.util.ArrayList)2 ByteBuf (io.netty.buffer.ByteBuf)1 CompositeByteBuf (io.netty.buffer.CompositeByteBuf)1 BufferedReader (java.io.BufferedReader)1 InputStreamReader (java.io.InputStreamReader)1 BenchmarkMode (org.openjdk.jmh.annotations.BenchmarkMode)1