Search in sources :

Example 1 with Threads

use of org.openjdk.jmh.annotations.Threads in project zeebe by zeebe-io.

the class POJOMappingBenchmark method performReadingReverseOrder.

@Benchmark
@Threads(1)
public void performReadingReverseOrder(POJOMappingContext ctx) {
    final TaskEvent taskEvent = ctx.getTaskEvent();
    final DirectBuffer encodedTaskEvent = ctx.getReverseOrderEncodedTaskEvent();
    taskEvent.reset();
    taskEvent.wrap(encodedTaskEvent, 0, encodedTaskEvent.capacity());
}
Also used : MutableDirectBuffer(org.agrona.MutableDirectBuffer) DirectBuffer(org.agrona.DirectBuffer) TaskEvent(io.zeebe.broker.taskqueue.data.TaskEvent) Threads(org.openjdk.jmh.annotations.Threads) Benchmark(org.openjdk.jmh.annotations.Benchmark)

Example 2 with Threads

use of org.openjdk.jmh.annotations.Threads in project apm-agent-java by elastic.

the class ObjectPoolBenchmark method testMixedObjectPool.

// @Benchmark
@Threads(8)
public Transaction testMixedObjectPool() {
    Transaction transaction = mixedObjectPool.createInstance();
    mixedObjectPool.recycle(transaction);
    return transaction;
}
Also used : Transaction(co.elastic.apm.impl.transaction.Transaction) Threads(org.openjdk.jmh.annotations.Threads)

Example 3 with Threads

use of org.openjdk.jmh.annotations.Threads in project apm-agent-java by elastic.

the class ObjectPoolBenchmark method testThreadLocalObjectPool.

@Benchmark
@Threads(8)
public Transaction testThreadLocalObjectPool() {
    Transaction transaction = threadLocalObjectPool.createInstance();
    threadLocalObjectPool.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 4 with Threads

use of org.openjdk.jmh.annotations.Threads in project atlasdb by palantir.

the class TransactionGetRowsColumnRangeBenchmarks method getAllColumnsSingleBigRow.

@Benchmark
@Threads(1)
@Warmup(time = 16, timeUnit = TimeUnit.SECONDS)
@Measurement(time = 160, timeUnit = TimeUnit.SECONDS)
public Object getAllColumnsSingleBigRow(VeryWideRowTable table, Blackhole blackhole) {
    return table.getTransactionManager().runTaskThrowOnConflict(txn -> {
        Iterator<Map.Entry<Cell, byte[]>> iter = txn.getRowsColumnRange(table.getTableRef(), Collections.singleton(Tables.ROW_BYTES.array()), new ColumnRangeSelection(null, null), 10000);
        int count = 0;
        while (iter.hasNext()) {
            blackhole.consume(iter.next());
            ++count;
        }
        Preconditions.checkState(count == table.getNumCols(), "Should be %s columns, but were: %s", table.getNumCols(), count);
        return count;
    });
}
Also used : 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 5 with Threads

use of org.openjdk.jmh.annotations.Threads in project atlasdb by palantir.

the class KvsGetRowsColumnRangeBenchmarks method getAllColumnsUnaligned.

@Benchmark
@Threads(1)
@Warmup(time = 16, timeUnit = TimeUnit.SECONDS)
@Measurement(time = 160, timeUnit = TimeUnit.SECONDS)
public Object getAllColumnsUnaligned(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), 10017, 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)

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