@GenerateMicroBenchmark @OperationsPerInvocation(CAPACITY) public void offer() { final Queue<Integer> lq = q; for (int i = 0; i < CAPACITY; i++) { lq.offer(TOKEN); } }
@GenerateMicroBenchmark @Group("tpt") public void offer(OpCounters counters) { if (!q.offer(ONE)) { counters.offerFail++; } if (DELAY_PRODUCER != 0) { BlackHole.consumeCPU(DELAY_PRODUCER); } }
@GenerateMicroBenchmark @Group("tpt") public void poll(OpCounters counters, ConsumerMarker cm) { if (q.poll() == null) { counters.pollFail++; } if (DELAY_CONSUMER != 0) { BlackHole.consumeCPU(DELAY_CONSUMER); } }
@GenerateMicroBenchmark @Group("tpt") public void offer(OpCounters counters) { if (!q.offer(ONE)) { counters.offerFail++; Thread.yield(); } if (DELAY_PRODUCER != 0) { BlackHole.consumeCPU(DELAY_PRODUCER); } }
@GenerateMicroBenchmark @Group("tpt") public void poll(OpCounters counters, ConsumerMarker cm) { if (q.poll() == null) { counters.pollFail++; Thread.yield(); } if (DELAY_CONSUMER != 0) { BlackHole.consumeCPU(DELAY_CONSUMER); } }
@GenerateMicroBenchmark @OperationsPerInvocation(CAPACITY) public void poll() { final Queue<Integer> lq = q; for (int i = 0; i < CAPACITY; i++) { lq.poll(); } }
@GenerateMicroBenchmark public void poll() { int offset = caq.calcOffset(index++); if (caq.lpElement(offset) != null) { index--; } }
@GenerateMicroBenchmark public void poll() { long offset = caq.calcOffset(index++); if (caq.lpElement(offset) != null) { index--; } }
@GenerateMicroBenchmark @BenchmarkMode(Mode.Throughput) @OutputTimeUnit(TimeUnit.SECONDS) @OperationsPerInvocation(1000) public void testFsync() throws IOException { for (int i = 0; i < 1000; i++) { writer.put("key" , "value"); } writer.flush(); }
@GenerateMicroBenchmark @Group("ring") @GroupThreads(1) public void ping(Control ctl, Source s) { s.ping(ctl); }
@GenerateMicroBenchmark @Group("ring") @GroupThreads(1) public void loop(Link l) { l.link(); }
@GenerateMicroBenchmark public void offer() { int offset = caq.calcOffset(index++); caq.spElement(offset, TOKEN); }
@GenerateMicroBenchmark public void offer() { long offset = caq.calcOffset(index++); caq.spElement(offset, TOKEN); }
@GenerateMicroBenchmark public boolean modification() { return this.benchmark(BenchmarkType.MODIFICATION); }
@GenerateMicroBenchmark public boolean grouping() { return this.benchmark(BenchmarkType.GROUPING); }
@GenerateMicroBenchmark public boolean laziness3() { return this.benchmark(BenchmarkType.LAZINESS3); }
@GenerateMicroBenchmark public boolean laziness6() { return this.benchmark(BenchmarkType.LAZINESS6); }
@GenerateMicroBenchmark public Object testFastMethod() throws Throwable { return fastMethod.invoke(null, null); }
@GenerateMicroBenchmark public Object testMethodAccessible() throws Throwable { return methodAccessible.invoke(null, null); }
@GenerateMicroBenchmark public Object testMethodNotAccessible() throws Throwable { return simpleMethod.invoke(null, null); }
@GenerateMicroBenchmark public Object testMethodHandleExact() throws Throwable { return (Integer)methodHandle.invokeExact(); }
@GenerateMicroBenchmark public Object testMethodHandle() throws Throwable { return (Integer)methodHandle.invoke(); }
@GenerateMicroBenchmark public Object testMethodDirect() throws Throwable { return TestedClass.getAStatic(); }
@GenerateMicroBenchmark public Object testFieldSaveAccessible() throws Exception { return fieldAccessible.get(testedObject); }
@GenerateMicroBenchmark public Object testFieldSaveNotAccessible() throws Exception { return simpleField.get(testedObject); }
@GenerateMicroBenchmark public Object testFieldStraighforward() throws Exception { return testedObject.c; }
@GenerateMicroBenchmark public Object testFieldSaveAccessible() throws Exception { return fieldAccessible.get(null); }
@GenerateMicroBenchmark public Object testFieldSaveNotAccessible() throws Exception { return simpleField.get(null); }
@GenerateMicroBenchmark public Object testFieldStraighforward() throws Exception { return TestedClass.cStat; }
@GenerateMicroBenchmark public Object testFastMethod() throws Throwable { return fastMethod.invoke(testedObject, null); }
@GenerateMicroBenchmark public Object testMethodAccessible() throws Throwable { return methodAccessible.invoke(testedObject, null); }
@GenerateMicroBenchmark public Object testMethodNotAccessible() throws Throwable { return simpleMethod.invoke(testedObject, null); }
@GenerateMicroBenchmark public Object testMethodHandleExact() throws Throwable { return (Integer)methodHandle.invokeExact(testedObject); }
@GenerateMicroBenchmark public Object testMethodHandle() throws Throwable { return (Integer)methodHandle.invoke(testedObject); }
@GenerateMicroBenchmark public Object testMethodDirect() throws Throwable { return testedObject.getA(); }
@GenerateMicroBenchmark @BenchmarkMode({Mode.SampleTime}) public LargeCacheObject simpleGet(LargeCacheKey key, LargeCacheObject value,XXJavaHashLargeTextBenchmarkCache cache) { return org.greencheek.spray.cache.memcached.perftests.SimpleGetBenchmarks.testLargeGet(key, value, cache); }