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);
}
}
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;
}
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;
}
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();
}
}
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();
}
}
Aggregations