@Benchmark @Group("tenMixedArgs") @GroupThreads(PRODUCER_THREADS) public boolean tenMixedArgsCaller(final Control control, final CallerCounters counters) { this.waitStrategy.control = control; try { this.proxy.tenMixedArgs(this.intArg, this.objArg, this.longArg, this.customType0, this.doubleArg, this.customType1, this.floatArg, this.customType2, this.booleanArg, this.customType3); counters.callsFailed = this.waitStrategy.retries; return true; } catch (final StoppedException e) { return false; } }
@Benchmark @Group("no_contention") @GroupThreads(1) public void no_contention_drain(DrainCounters counters, ConsumerMarker cm) { q.drainTo(next -> { counters.drained++; next.deferred.resolve(null); return true; }); }
@Benchmark @Group("mild_contention") @GroupThreads(1) public void mild_contention_drain(DrainCounters counters, ConsumerMarker cm) { q.drainTo(next -> { counters.drained++; next.deferred.resolve(null); return true; }); }
@Benchmark @Group("high_contention") @GroupThreads(1) public void high_contention_drain(DrainCounters counters, ConsumerMarker cm) { q.drainTo(next -> { counters.drained++; next.deferred.resolve(null); return true; }); }
@Benchmark @Group("g") @GroupThreads(3) public void writing() { concurrentLinkedQueue.offer("test"); }
@Benchmark @Group("g") @GroupThreads(1) public void reading() { concurrentLinkedQueue.poll(); }
@Benchmark @Group("no_contention") @GroupThreads(1) public void no_contention_offer(OfferCounters counters) { if (q.offer(ONE, 1)) { counters.offersMade++; } else { counters.offersFailed++; } }
@Benchmark @Group("no_contention") @GroupThreads(1) public void no_contention_drain(DrainCounters counters, ConsumerMarker cm) { q.drainTo((s, b) -> { counters.drained++; return true; }, 1000); }
@Benchmark @Group("mild_contention") @GroupThreads(2) public void mild_contention_offer(OfferCounters counters) { if (q.offer(ONE, 1)) { counters.offersMade++; } else { counters.offersFailed++; } }
@Benchmark @Group("mild_contention") @GroupThreads(1) public void mild_contention_drain(DrainCounters counters, ConsumerMarker cm) { q.drainTo((s, b) -> { counters.drained++; return true; }, 1000); }
@Benchmark @Group("high_contention") @GroupThreads(8) public void high_contention_offer(OfferCounters counters) { if (q.offer(ONE, 1)) { counters.offersMade++; } else { counters.offersFailed++; } }
@Benchmark @Group("high_contention") @GroupThreads(1) public void high_contention_drain(DrainCounters counters, ConsumerMarker cm) { q.drainTo((s, b) -> { counters.drained++; return true; }, 1000); }
@Benchmark @Warmup(iterations = WARMUP_COUNT) @Fork(value = FORK_COUNT) @Measurement(iterations = ITERATION_COUNT) @Group("circularBuffer") @GroupThreads(1) public void circularBufferAddEvent() { circularFifoBuffer.add(event); }
@Benchmark @Warmup(iterations = WARMUP_COUNT) @Fork(value = FORK_COUNT) @Measurement(iterations = ITERATION_COUNT) @Group("circularBuffer") @GroupThreads(1) public void circularBufferToList(Blackhole bh) { List<Object> events = circularFifoBuffer.toList(); bh.consume(events); }
@Benchmark @Warmup(iterations = WARMUP_COUNT) @Fork(value = FORK_COUNT) @Measurement(iterations = ITERATION_COUNT) @Group("circularBuffer") @GroupThreads(1) public void circularBufferSize(Blackhole bh) { int size = circularFifoBuffer.size(); bh.consume(size); }
@Benchmark @Warmup(iterations = WARMUP_COUNT) @Fork(value = FORK_COUNT) @Measurement(iterations = ITERATION_COUNT) @Group("circularBuffer") @GroupThreads(1) public void circularBufferTakeEvent(Blackhole bh) { Option<Object> event = circularFifoBuffer.take(); bh.consume(event); }
@Benchmark @Warmup(iterations = WARMUP_COUNT) @Fork(value = FORK_COUNT) @Measurement(iterations = ITERATION_COUNT) @Group("concurrentEvictingQueue") @GroupThreads(2) public void concurrentEvictingQueueAdd() { queue.add(event); }
@Benchmark @Warmup(iterations = WARMUP_COUNT) @Fork(value = FORK_COUNT) @Measurement(iterations = ITERATION_COUNT) @Group("concurrentEvictingQueue") @GroupThreads(1) public void concurrentEvictingQueueSize(Blackhole bh) { int size = queue.size(); bh.consume(size); }
@Benchmark @Warmup(iterations = WARMUP_COUNT) @Fork(value = FORK_COUNT) @Measurement(iterations = ITERATION_COUNT) @Group("concurrentEvictingQueue") @GroupThreads(1) public void concurrentEvictingQueuePoll(Blackhole bh) { Object event = queue.poll(); bh.consume(event); }
@Benchmark @Warmup(iterations = WARMUP_COUNT) @Fork(value = FORK_COUNT) @Measurement(iterations = ITERATION_COUNT) @Group("concurrentEvictingQueue") @GroupThreads(1) public void concurrentEvictingQueuePeek(Blackhole bh) { Object event = queue.peek(); bh.consume(event); }
/** * */ @Benchmark @GroupThreads(THREAD_COUNT) @Group("park") public void unpark() { LockSupport.unpark(thread); }
/** * */ @Benchmark @Group("condition") @GroupThreads(THREAD_COUNT) public void notifyAll0() { synchronized (mux) { mux.notify(); } }
@Benchmark @Warmup(iterations = 0) @Measurement(iterations = 1, time = 100, timeUnit = TimeUnit.MILLISECONDS) @Fork(1) @Group("T") @GroupThreads(4) public void test() { Fixtures.work(); }
@Benchmark @Warmup(iterations = 0) @Measurement(iterations = 1, time = 100, timeUnit = TimeUnit.MILLISECONDS) @Fork(1) @Group("T") @GroupThreads(4) public void test(MyState state) { Fixtures.work(); }
@Benchmark @BenchmarkMode(Mode.All) @Warmup(iterations = 0) @Measurement(iterations = 1, time = 1) @Fork(1) @Group("T") @GroupThreads(4) public void test() { Fixtures.work(); }
@Benchmark @BenchmarkMode(Mode.All) @Warmup(iterations = 0) @Measurement(iterations = 1, time = 1) @Fork(1) @Group("T") @GroupThreads(4) public void doTest() { Assert.fail(); }
@Benchmark @BenchmarkMode(Mode.All) @Warmup(iterations = 0) @Measurement(iterations = 1, time = 1) @Fork(1) @Group("T") @GroupThreads(4) public void test(MyState state) { Fixtures.work(); }
@Benchmark @Group("test") @GroupThreads(1) public void test1() { test1threads.add(Thread.currentThread()); Fixtures.work(); }
@Benchmark @Group("test") @GroupThreads(2) public void test2() { test2threads.add(Thread.currentThread()); Fixtures.work(); }
@Benchmark @Group("test") @GroupThreads(0) public void test1() { test1threads.add(Thread.currentThread()); Fixtures.work(); }