Search in sources :

Example 31 with Benchmark

use of org.openjdk.jmh.annotations.Benchmark in project pinot by linkedin.

the class BenchmarkFileRead method readSVs.

/*@Benchmark
  @OutputTimeUnit(TimeUnit.MILLISECONDS)
  public void test() {
    byteBuffer.rewind();
    byte[] rawData = new byte[length];

    byteBuffer.rewind();
    for (int i = 0; i < length; i++) {
      rawData[i] = byteBuffer.get();
    }
  }*/
@Benchmark
@BenchmarkMode({ Mode.SampleTime })
@OutputTimeUnit(TimeUnit.MILLISECONDS)
public void readSVs() throws IOException {
    int rows = 25000000;
    int columnSizeInBits = 3;
    boolean isMMap = true;
    boolean hasNulls = false;
    PinotDataBuffer dataBuffer = PinotDataBuffer.fromFile(file, ReadMode.mmap, FileChannel.MapMode.READ_ONLY, "benchmark");
    FixedBitSingleValueReader reader = new FixedBitSingleValueReader(dataBuffer, rows, columnSizeInBits, hasNulls);
    int[] result2 = new int[rows];
    for (int i = 0; i < rows; i++) {
        result2[i] = reader.getInt(i);
    }
}
Also used : PinotDataBuffer(com.linkedin.pinot.core.segment.memory.PinotDataBuffer) FixedBitSingleValueReader(com.linkedin.pinot.core.io.reader.impl.v1.FixedBitSingleValueReader) BenchmarkMode(org.openjdk.jmh.annotations.BenchmarkMode) Benchmark(org.openjdk.jmh.annotations.Benchmark) OutputTimeUnit(org.openjdk.jmh.annotations.OutputTimeUnit)

Example 32 with Benchmark

use of org.openjdk.jmh.annotations.Benchmark in project netty by netty.

the class PrivilegedSocketOperationsBenchmark method testWithoutSMNoPrivileged.

@Benchmark
public ServerSocketChannel testWithoutSMNoPrivileged(final SecurityManagerEmpty sm) throws IOException {
    final ServerSocketChannel ssc = ServerSocketChannel.open();
    ssc.socket().bind(null);
    ssc.configureBlocking(false);
    ssc.accept();
    ssc.close();
    return ssc;
}
Also used : ServerSocketChannel(java.nio.channels.ServerSocketChannel) Benchmark(org.openjdk.jmh.annotations.Benchmark)

Example 33 with Benchmark

use of org.openjdk.jmh.annotations.Benchmark in project netty by netty.

the class PrivilegedSocketOperationsBenchmark method testWithSMNoPrivileged.

@Benchmark
public ServerSocketChannel testWithSMNoPrivileged(final SecurityManagerInstalled sm) throws IOException {
    final ServerSocketChannel ssc = ServerSocketChannel.open();
    ssc.socket().bind(null);
    ssc.configureBlocking(false);
    ssc.accept();
    ssc.close();
    return ssc;
}
Also used : ServerSocketChannel(java.nio.channels.ServerSocketChannel) Benchmark(org.openjdk.jmh.annotations.Benchmark)

Example 34 with Benchmark

use of org.openjdk.jmh.annotations.Benchmark in project netty by netty.

the class PrivilegedSocketOperationsBenchmark method testWithSM.

@Benchmark
public ServerSocketChannel testWithSM(final SecurityManagerInstalled sm) throws IOException {
    try {
        final ServerSocketChannel ssc = AccessController.doPrivileged(new PrivilegedExceptionAction<ServerSocketChannel>() {

            @Override
            public ServerSocketChannel run() throws Exception {
                final ServerSocketChannel ssc = ServerSocketChannel.open();
                ssc.socket().bind(null);
                ssc.configureBlocking(false);
                ssc.accept();
                return ssc;
            }
        });
        ssc.close();
        return ssc;
    } catch (final PrivilegedActionException e) {
        throw (IOException) e.getCause();
    }
}
Also used : PrivilegedActionException(java.security.PrivilegedActionException) ServerSocketChannel(java.nio.channels.ServerSocketChannel) PrivilegedActionException(java.security.PrivilegedActionException) URISyntaxException(java.net.URISyntaxException) IOException(java.io.IOException) NoSuchAlgorithmException(java.security.NoSuchAlgorithmException) Benchmark(org.openjdk.jmh.annotations.Benchmark)

Example 35 with Benchmark

use of org.openjdk.jmh.annotations.Benchmark in project netty by netty.

the class PrivilegedSocketOperationsBenchmark method testWithoutSM.

@Benchmark
public ServerSocketChannel testWithoutSM(final SecurityManagerEmpty sm) throws IOException {
    try {
        final ServerSocketChannel ssc = AccessController.doPrivileged(new PrivilegedExceptionAction<ServerSocketChannel>() {

            @Override
            public ServerSocketChannel run() throws Exception {
                final ServerSocketChannel ssc = ServerSocketChannel.open();
                ssc.socket().bind(null);
                ssc.configureBlocking(false);
                ssc.accept();
                return ssc;
            }
        });
        ssc.close();
        return ssc;
    } catch (final PrivilegedActionException e) {
        throw (IOException) e.getCause();
    }
}
Also used : PrivilegedActionException(java.security.PrivilegedActionException) ServerSocketChannel(java.nio.channels.ServerSocketChannel) PrivilegedActionException(java.security.PrivilegedActionException) URISyntaxException(java.net.URISyntaxException) IOException(java.io.IOException) NoSuchAlgorithmException(java.security.NoSuchAlgorithmException) Benchmark(org.openjdk.jmh.annotations.Benchmark)

Aggregations

Benchmark (org.openjdk.jmh.annotations.Benchmark)142 BenchmarkMode (org.openjdk.jmh.annotations.BenchmarkMode)96 OutputTimeUnit (org.openjdk.jmh.annotations.OutputTimeUnit)93 QueryableIndexSegment (io.druid.segment.QueryableIndexSegment)37 Result (io.druid.query.Result)27 InputRow (io.druid.data.input.InputRow)25 Row (io.druid.data.input.Row)21 ArrayList (java.util.ArrayList)17 TopNResultValue (io.druid.query.topn.TopNResultValue)15 Cursor (io.druid.segment.Cursor)15 ImmutableBitmap (io.druid.collections.bitmap.ImmutableBitmap)13 QueryableIndexStorageAdapter (io.druid.segment.QueryableIndexStorageAdapter)13 StorageAdapter (io.druid.segment.StorageAdapter)13 List (java.util.List)13 BoundDimFilter (io.druid.query.filter.BoundDimFilter)9 DimFilter (io.druid.query.filter.DimFilter)9 OperationsPerInvocation (org.openjdk.jmh.annotations.OperationsPerInvocation)9 Page (com.facebook.presto.spi.Page)8 OrDimFilter (io.druid.query.filter.OrDimFilter)8 SelectorDimFilter (io.druid.query.filter.SelectorDimFilter)8