@GenerateMicroBenchmark
@OperationsPerInvocation(CAPACITY)
public void offer()
{
final Queue<Integer> lq = q;
for (int i = 0; i < CAPACITY; i++)
{
lq.offer(TOKEN);
}
}
java类org.openjdk.jmh.annotations.GenerateMicroBenchmark的实例源码
SingleThreadedOffer.java 文件源码
项目:lin-check
阅读 35
收藏 0
点赞 0
评论 0
QueueThroughputBusy.java 文件源码
项目:lin-check
阅读 29
收藏 0
点赞 0
评论 0
@GenerateMicroBenchmark
@Group("tpt")
public void offer(OpCounters counters) {
if (!q.offer(ONE)) {
counters.offerFail++;
}
if (DELAY_PRODUCER != 0) {
BlackHole.consumeCPU(DELAY_PRODUCER);
}
}
QueueThroughputBusy.java 文件源码
项目:lin-check
阅读 25
收藏 0
点赞 0
评论 0
@GenerateMicroBenchmark
@Group("tpt")
public void poll(OpCounters counters, ConsumerMarker cm) {
if (q.poll() == null) {
counters.pollFail++;
}
if (DELAY_CONSUMER != 0) {
BlackHole.consumeCPU(DELAY_CONSUMER);
}
}
QueueThroughputYield.java 文件源码
项目:lin-check
阅读 28
收藏 0
点赞 0
评论 0
@GenerateMicroBenchmark
@Group("tpt")
public void offer(OpCounters counters) {
if (!q.offer(ONE)) {
counters.offerFail++;
Thread.yield();
}
if (DELAY_PRODUCER != 0) {
BlackHole.consumeCPU(DELAY_PRODUCER);
}
}
QueueThroughputYield.java 文件源码
项目:lin-check
阅读 30
收藏 0
点赞 0
评论 0
@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);
}
}
SingleThreadedPoll.java 文件源码
项目:lin-check
阅读 22
收藏 0
点赞 0
评论 0
@GenerateMicroBenchmark
@OperationsPerInvocation(CAPACITY)
public void poll()
{
final Queue<Integer> lq = q;
for (int i = 0; i < CAPACITY; i++)
{
lq.poll();
}
}
CircularArray3ReadWrite.java 文件源码
项目:lin-check
阅读 30
收藏 0
点赞 0
评论 0
@GenerateMicroBenchmark
public void poll() {
int offset = caq.calcOffset(index++);
if (caq.lpElement(offset) != null) {
index--;
}
}
CircularArray4ReadWrite.java 文件源码
项目:lin-check
阅读 29
收藏 0
点赞 0
评论 0
@GenerateMicroBenchmark
public void poll() {
long offset = caq.calcOffset(index++);
if (caq.lpElement(offset) != null) {
index--;
}
}
CircularArray2ReadWrite.java 文件源码
项目:lin-check
阅读 35
收藏 0
点赞 0
评论 0
@GenerateMicroBenchmark
public void poll() {
int offset = caq.calcOffset(index++);
if (caq.lpElement(offset) != null) {
index--;
}
}
CircularArray1ReadWrite.java 文件源码
项目:lin-check
阅读 30
收藏 0
点赞 0
评论 0
@GenerateMicroBenchmark
public void poll() {
int offset = caq.calcOffset(index++);
if (caq.lpElement(offset) != null) {
index--;
}
}
FsyncBenchmark.java 文件源码
项目:sparkey-java
阅读 25
收藏 0
点赞 0
评论 0
@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();
}
QueueRoundTripLatency.java 文件源码
项目:lin-check
阅读 26
收藏 0
点赞 0
评论 0
@GenerateMicroBenchmark
@Group("ring")
@GroupThreads(1)
public void ping(Control ctl, Source s) {
s.ping(ctl);
}
QueueRoundTripLatency.java 文件源码
项目:lin-check
阅读 33
收藏 0
点赞 0
评论 0
@GenerateMicroBenchmark
@Group("ring")
@GroupThreads(1)
public void loop(Link l) {
l.link();
}
CircularArray3ReadWrite.java 文件源码
项目:lin-check
阅读 21
收藏 0
点赞 0
评论 0
@GenerateMicroBenchmark
public void offer() {
int offset = caq.calcOffset(index++);
caq.spElement(offset, TOKEN);
}
CircularArray4ReadWrite.java 文件源码
项目:lin-check
阅读 30
收藏 0
点赞 0
评论 0
@GenerateMicroBenchmark
public void offer() {
long offset = caq.calcOffset(index++);
caq.spElement(offset, TOKEN);
}
CircularArray2ReadWrite.java 文件源码
项目:lin-check
阅读 27
收藏 0
点赞 0
评论 0
@GenerateMicroBenchmark
public void offer() {
int offset = caq.calcOffset(index++);
caq.spElement(offset, TOKEN);
}
CircularArray1ReadWrite.java 文件源码
项目:lin-check
阅读 29
收藏 0
点赞 0
评论 0
@GenerateMicroBenchmark
public void offer() {
int offset = caq.calcOffset(index++);
caq.spElement(offset, TOKEN);
}
Benchmark.java 文件源码
项目:phreak-examples
阅读 31
收藏 0
点赞 0
评论 0
@GenerateMicroBenchmark
public boolean modification() {
return this.benchmark(BenchmarkType.MODIFICATION);
}
Benchmark.java 文件源码
项目:phreak-examples
阅读 34
收藏 0
点赞 0
评论 0
@GenerateMicroBenchmark
public boolean grouping() {
return this.benchmark(BenchmarkType.GROUPING);
}
Benchmark.java 文件源码
项目:phreak-examples
阅读 34
收藏 0
点赞 0
评论 0
@GenerateMicroBenchmark
public boolean laziness3() {
return this.benchmark(BenchmarkType.LAZINESS3);
}
Benchmark.java 文件源码
项目:phreak-examples
阅读 33
收藏 0
点赞 0
评论 0
@GenerateMicroBenchmark
public boolean laziness6() {
return this.benchmark(BenchmarkType.LAZINESS6);
}
ReflectionMethodStaticAccess.java 文件源码
项目:reflection-access-tests
阅读 29
收藏 0
点赞 0
评论 0
@GenerateMicroBenchmark
public Object testFastMethod() throws Throwable {
return fastMethod.invoke(null, null);
}
ReflectionMethodStaticAccess.java 文件源码
项目:reflection-access-tests
阅读 26
收藏 0
点赞 0
评论 0
@GenerateMicroBenchmark
public Object testMethodAccessible() throws Throwable {
return methodAccessible.invoke(null, null);
}
ReflectionMethodStaticAccess.java 文件源码
项目:reflection-access-tests
阅读 34
收藏 0
点赞 0
评论 0
@GenerateMicroBenchmark
public Object testMethodNotAccessible() throws Throwable {
return simpleMethod.invoke(null, null);
}
ReflectionMethodStaticAccess.java 文件源码
项目:reflection-access-tests
阅读 39
收藏 0
点赞 0
评论 0
@GenerateMicroBenchmark
public Object testMethodHandleExact() throws Throwable {
return (Integer)methodHandle.invokeExact();
}
ReflectionMethodStaticAccess.java 文件源码
项目:reflection-access-tests
阅读 33
收藏 0
点赞 0
评论 0
@GenerateMicroBenchmark
public Object testMethodHandle() throws Throwable {
return (Integer)methodHandle.invoke();
}
ReflectionMethodStaticAccess.java 文件源码
项目:reflection-access-tests
阅读 33
收藏 0
点赞 0
评论 0
@GenerateMicroBenchmark
public Object testMethodDirect() throws Throwable {
return TestedClass.getAStatic();
}
ReflectionFieldAccess.java 文件源码
项目:reflection-access-tests
阅读 28
收藏 0
点赞 0
评论 0
@GenerateMicroBenchmark
public Object testFieldSaveAccessible() throws Exception {
return fieldAccessible.get(testedObject);
}
ReflectionFieldAccess.java 文件源码
项目:reflection-access-tests
阅读 39
收藏 0
点赞 0
评论 0
@GenerateMicroBenchmark
public Object testFieldSaveNotAccessible() throws Exception {
return simpleField.get(testedObject);
}
ReflectionFieldAccess.java 文件源码
项目:reflection-access-tests
阅读 24
收藏 0
点赞 0
评论 0
@GenerateMicroBenchmark
public Object testFieldStraighforward() throws Exception {
return testedObject.c;
}