use of com.carrotsearch.junitbenchmarks.BenchmarkOptions in project druid by druid-io.
the class BitmapCreationBenchmark method testLinearAddition.
@BenchmarkOptions(warmupRounds = 10, benchmarkRounds = 1000)
@Test
public void testLinearAddition() {
MutableBitmap mutableBitmap = factory.makeEmptyMutableBitmap();
for (int i = 0; i < NUM_BITS; ++i) {
mutableBitmap.add(i);
}
Assert.assertEquals(NUM_BITS, mutableBitmap.size());
}
use of com.carrotsearch.junitbenchmarks.BenchmarkOptions in project druid by druid-io.
the class BitmapCreationBenchmark method testFromImmutableByteArray.
@BenchmarkOptions(warmupRounds = 10, benchmarkRounds = 1000)
@Test
public void testFromImmutableByteArray() {
ImmutableBitmap immutableBitmap = factory.mapImmutableBitmap(baseByteBuffer);
Assert.assertEquals(NUM_BITS, immutableBitmap.size());
}
use of com.carrotsearch.junitbenchmarks.BenchmarkOptions in project DirectMemory by raffaeleguidi.
the class TestCachePlusSerialization method basicBench.
@BenchmarkOptions(benchmarkRounds = 50000, warmupRounds = 0, concurrency = 1)
@Test
public void basicBench() {
DummyPojo d = new DummyPojo("test-" + rnd.nextInt(100000), 1024 + rnd.nextInt(1024));
Cache.put(d.name, d);
DummyPojo d2 = (DummyPojo) Cache.retrieve(d.name);
assertEquals(d.name, d2.name);
}
use of com.carrotsearch.junitbenchmarks.BenchmarkOptions in project DirectMemory by raffaeleguidi.
the class ConcurrentTests method retrieveCatchThemAll.
@BenchmarkOptions(benchmarkRounds = 1000000, warmupRounds = 0, concurrency = 100)
@Test
public void retrieveCatchThemAll() {
String key = "test-" + (rndGen.nextInt(entries) + 1);
Pointer p = map.get(key);
read.incrementAndGet();
if (p != null) {
got.incrementAndGet();
byte[] payload = mem.retrieve(p);
if (key.equals(new String(payload)))
good.incrementAndGet();
else
bad.incrementAndGet();
} else {
logger.info("did not find key " + key);
missed.incrementAndGet();
}
}
use of com.carrotsearch.junitbenchmarks.BenchmarkOptions in project DirectMemory by raffaeleguidi.
the class PreliminarBenchmarks method testAllocation.
@BenchmarkOptions(benchmarkRounds = 1, warmupRounds = 0)
@Test
public void testAllocation() {
logger.info("payload is " + payload.length + " bytes");
logger.info("allocating " + Ram.inMb(payload.length * 200000));
ByteBuffer buf = ByteBuffer.allocateDirect(payload.length * 200000);
assertNotNull(buf);
logger.info("done");
}
Aggregations