Java 类org.openjdk.jmh.annotations.GenerateMicroBenchmark 实例源码

项目:lin-check    文件:SingleThreadedOffer.java   
@GenerateMicroBenchmark
@OperationsPerInvocation(CAPACITY)
public void offer()
{
    final Queue<Integer> lq = q;
    for (int i = 0; i < CAPACITY; i++)
    {
        lq.offer(TOKEN);
    }
}
项目:lin-check    文件:QueueThroughputBusy.java   
@GenerateMicroBenchmark
@Group("tpt")
public void offer(OpCounters counters) {
    if (!q.offer(ONE)) {
        counters.offerFail++;
    } 
    if (DELAY_PRODUCER != 0) {
        BlackHole.consumeCPU(DELAY_PRODUCER);
    }
}
项目:lin-check    文件:QueueThroughputBusy.java   
@GenerateMicroBenchmark
@Group("tpt")
public void poll(OpCounters counters, ConsumerMarker cm) {
    if (q.poll() == null) {
        counters.pollFail++;
    } 
    if (DELAY_CONSUMER != 0) {
        BlackHole.consumeCPU(DELAY_CONSUMER);
    }
}
项目:lin-check    文件:QueueThroughputYield.java   
@GenerateMicroBenchmark
@Group("tpt")
public void offer(OpCounters counters) {
    if (!q.offer(ONE)) {
        counters.offerFail++;
        Thread.yield();
    } 
    if (DELAY_PRODUCER != 0) {
        BlackHole.consumeCPU(DELAY_PRODUCER);
    }
}
项目:lin-check    文件:QueueThroughputYield.java   
@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);
    }
}
项目:lin-check    文件:SingleThreadedPoll.java   
@GenerateMicroBenchmark
@OperationsPerInvocation(CAPACITY)
public void poll()
{
    final Queue<Integer> lq = q;
    for (int i = 0; i < CAPACITY; i++)
    {
        lq.poll();
    }
}
项目:lin-check    文件:CircularArray3ReadWrite.java   
@GenerateMicroBenchmark
public void poll() {
    int offset = caq.calcOffset(index++);
    if (caq.lpElement(offset) != null) {
        index--;
    }
}
项目:lin-check    文件:CircularArray4ReadWrite.java   
@GenerateMicroBenchmark
public void poll() {
    long offset = caq.calcOffset(index++);
    if (caq.lpElement(offset) != null) {
        index--;
    }
}
项目:lin-check    文件:CircularArray2ReadWrite.java   
@GenerateMicroBenchmark
public void poll() {
    int offset = caq.calcOffset(index++);
    if (caq.lpElement(offset) != null) {
        index--;
    }
}
项目:lin-check    文件:CircularArray1ReadWrite.java   
@GenerateMicroBenchmark
public void poll() {
    int offset = caq.calcOffset(index++);
    if (caq.lpElement(offset) != null) {
        index--;
    }
}
项目:sparkey-java    文件:FsyncBenchmark.java   
@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();
}
项目:lin-check    文件:QueueRoundTripLatency.java   
@GenerateMicroBenchmark
@Group("ring")
@GroupThreads(1)
public void ping(Control ctl, Source s) {
    s.ping(ctl);
}
项目:lin-check    文件:QueueRoundTripLatency.java   
@GenerateMicroBenchmark
@Group("ring")
@GroupThreads(1)
public void loop(Link l) {
    l.link();
}
项目:lin-check    文件:CircularArray3ReadWrite.java   
@GenerateMicroBenchmark
public void offer() {
    int offset = caq.calcOffset(index++);
    caq.spElement(offset, TOKEN);
}
项目:lin-check    文件:CircularArray4ReadWrite.java   
@GenerateMicroBenchmark
public void offer() {
    long offset = caq.calcOffset(index++);
    caq.spElement(offset, TOKEN);
}
项目:lin-check    文件:CircularArray2ReadWrite.java   
@GenerateMicroBenchmark
public void offer() {
    int offset = caq.calcOffset(index++);
    caq.spElement(offset, TOKEN);
}
项目:lin-check    文件:CircularArray1ReadWrite.java   
@GenerateMicroBenchmark
public void offer() {
    int offset = caq.calcOffset(index++);
    caq.spElement(offset, TOKEN);
}
项目:phreak-examples    文件:Benchmark.java   
@GenerateMicroBenchmark
public boolean modification() {
    return this.benchmark(BenchmarkType.MODIFICATION);
}
项目:phreak-examples    文件:Benchmark.java   
@GenerateMicroBenchmark
public boolean grouping() {
    return this.benchmark(BenchmarkType.GROUPING);
}
项目:phreak-examples    文件:Benchmark.java   
@GenerateMicroBenchmark
public boolean laziness3() {
    return this.benchmark(BenchmarkType.LAZINESS3);
}
项目:phreak-examples    文件:Benchmark.java   
@GenerateMicroBenchmark
public boolean laziness6() {
    return this.benchmark(BenchmarkType.LAZINESS6);
}
项目:reflection-access-tests    文件:ReflectionMethodStaticAccess.java   
@GenerateMicroBenchmark
public Object testFastMethod() throws Throwable {
    return fastMethod.invoke(null, null);
}
项目:reflection-access-tests    文件:ReflectionMethodStaticAccess.java   
@GenerateMicroBenchmark
public Object testMethodAccessible() throws Throwable {
    return methodAccessible.invoke(null, null);
}
项目:reflection-access-tests    文件:ReflectionMethodStaticAccess.java   
@GenerateMicroBenchmark
public Object testMethodNotAccessible() throws Throwable {
    return simpleMethod.invoke(null, null);
}
项目:reflection-access-tests    文件:ReflectionMethodStaticAccess.java   
@GenerateMicroBenchmark
public Object testMethodHandleExact() throws Throwable {
    return (Integer)methodHandle.invokeExact();
}
项目:reflection-access-tests    文件:ReflectionMethodStaticAccess.java   
@GenerateMicroBenchmark
public Object testMethodHandle() throws Throwable {
    return (Integer)methodHandle.invoke();
}
项目:reflection-access-tests    文件:ReflectionMethodStaticAccess.java   
@GenerateMicroBenchmark
public Object testMethodDirect() throws Throwable {
    return TestedClass.getAStatic();
}
项目:reflection-access-tests    文件:ReflectionFieldAccess.java   
@GenerateMicroBenchmark
public Object testFieldSaveAccessible() throws Exception {
    return fieldAccessible.get(testedObject);
}
项目:reflection-access-tests    文件:ReflectionFieldAccess.java   
@GenerateMicroBenchmark
public Object testFieldSaveNotAccessible() throws Exception {
    return simpleField.get(testedObject);
}
项目:reflection-access-tests    文件:ReflectionFieldAccess.java   
@GenerateMicroBenchmark
public Object testFieldStraighforward() throws Exception {
    return testedObject.c;
}
项目:reflection-access-tests    文件:ReflectionFieldStaticAccess.java   
@GenerateMicroBenchmark
public Object testFieldSaveAccessible() throws Exception {
    return fieldAccessible.get(null);
}
项目:reflection-access-tests    文件:ReflectionFieldStaticAccess.java   
@GenerateMicroBenchmark
public Object testFieldSaveNotAccessible() throws Exception {
    return simpleField.get(null);
}
项目:reflection-access-tests    文件:ReflectionFieldStaticAccess.java   
@GenerateMicroBenchmark
public Object testFieldStraighforward() throws Exception {
    return TestedClass.cStat;
}
项目:reflection-access-tests    文件:ReflectionMethodAccess.java   
@GenerateMicroBenchmark
public Object testFastMethod() throws Throwable {
    return fastMethod.invoke(testedObject, null);
}
项目:reflection-access-tests    文件:ReflectionMethodAccess.java   
@GenerateMicroBenchmark
public Object testMethodAccessible() throws Throwable {
    return methodAccessible.invoke(testedObject, null);
}
项目:reflection-access-tests    文件:ReflectionMethodAccess.java   
@GenerateMicroBenchmark
public Object testMethodNotAccessible() throws Throwable {
    return simpleMethod.invoke(testedObject, null);
}
项目:reflection-access-tests    文件:ReflectionMethodAccess.java   
@GenerateMicroBenchmark
public Object testMethodHandleExact() throws Throwable {
    return (Integer)methodHandle.invokeExact(testedObject);
}
项目:reflection-access-tests    文件:ReflectionMethodAccess.java   
@GenerateMicroBenchmark
public Object testMethodHandle() throws Throwable {
    return (Integer)methodHandle.invoke(testedObject);
}
项目:reflection-access-tests    文件:ReflectionMethodAccess.java   
@GenerateMicroBenchmark
public Object testMethodDirect() throws Throwable {
    return testedObject.getA();
}
项目:spray-cache-spymemcached    文件:SimpleLargeGetBenchmark.java   
@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);
}