Java Code Examples for org.openjdk.jmh.annotations.Level#Iteration

The following examples show how to use org.openjdk.jmh.annotations.Level#Iteration . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: AbstractSslEngineThroughputBenchmark.java    From netty-4.1.22 with Apache License 2.0 6 votes vote down vote up
@Setup(Level.Iteration)
public final void setup() throws Exception {
    ByteBufAllocator allocator = new PooledByteBufAllocator(true);
    initEngines(allocator);
    initHandshakeBuffers();

    wrapDstBuffer = allocateBuffer(clientEngine.getSession().getPacketBufferSize() << 2);
    wrapSrcBuffer = allocateBuffer(messageSize);

    byte[] bytes = new byte[messageSize];
    PlatformDependent.threadLocalRandom().nextBytes(bytes);
    wrapSrcBuffer.put(bytes);
    wrapSrcBuffer.flip();

    // Complete the initial TLS handshake.
    if (!doHandshake()) {
        throw new IllegalStateException();
    }
    doSetup();
}
 
Example 2
Source File: BenchmarkChunkManager.java    From hadoop-ozone with Apache License 2.0 5 votes vote down vote up
@Setup(Level.Iteration)
public void setup() throws IOException {
  dir = getTestDir();
  config = new OzoneConfiguration();
  HddsVolume volume = new HddsVolume.Builder(dir.getAbsolutePath())
      .conf(config)
      .datanodeUuid(DATANODE_ID)
      .build();

  volumeSet = new ImmutableVolumeSet(volume);

  byte[] arr = randomAlphanumeric(chunkSize).getBytes(UTF_8);
  buffer = ChunkBuffer.wrap(ByteBuffer.wrap(arr));
}
 
Example 3
Source File: AbstractSslHandlerThroughputBenchmark.java    From netty-4.1.22 with Apache License 2.0 5 votes vote down vote up
@Setup(Level.Iteration)
public final void setup() throws Exception {
    allocator = new PooledByteBufAllocator(true);

    initSslHandlers(allocator);

    wrapSrcBuffer = allocateBuffer(messageSize);

    byte[] bytes = new byte[messageSize];
    PlatformDependent.threadLocalRandom().nextBytes(bytes);
    wrapSrcBuffer.writeBytes(bytes);

    // Complete the initial TLS handshake.
    doHandshake();
}
 
Example 4
Source File: SpherePerformance.java    From commons-geometry with Apache License 2.0 5 votes vote down vote up
/** Set up the instance for the benchmark. */
@Setup(Level.Iteration)
public void setup() {
    final Sphere sphere = randomSphere(RandomSource.create(RandomSource.XO_RO_SHI_RO_128_PP));

    tree = sphere.toTree(getSubdivisions());
}
 
Example 5
Source File: AbstractSslEngineThroughputBenchmark.java    From netty-4.1.22 with Apache License 2.0 5 votes vote down vote up
@TearDown(Level.Iteration)
public final void tearDown() throws Exception {
    destroyEngines();
    destroyHandshakeBuffers();
    freeBuffer(wrapSrcBuffer);
    freeBuffer(wrapDstBuffer);
    doTearDown();
}
 
Example 6
Source File: Benchmarks.java    From sdn-rx with Apache License 2.0 5 votes vote down vote up
@Setup(Level.Iteration)
public void prepareTestData() throws IOException {
	try (BufferedReader moviesReader = new BufferedReader(
		new InputStreamReader(this.getClass().getResourceAsStream("/movies.cypher")));
		Session session = driver.session()) {
		String moviesCypher = moviesReader.lines().collect(Collectors.joining(" "));
		session.run("CREATE INDEX ON :Movie(title)");
		session.run("MATCH (n) DETACH DELETE n");
		session.run(moviesCypher);
	}
}
 
Example 7
Source File: Benchmarks.java    From sdn-rx with Apache License 2.0 5 votes vote down vote up
@Setup(Level.Iteration)
public void prepareTestData() throws IOException {
	try (BufferedReader moviesReader = new BufferedReader(
		new InputStreamReader(this.getClass().getResourceAsStream("/movies.cypher")));
		Session session = driver.session()) {
		String moviesCypher = moviesReader.lines().collect(Collectors.joining(" "));
		session.run("CREATE INDEX ON :Movie(title)");
		session.run("MATCH (n) DETACH DELETE n");
		session.run(moviesCypher);
	}
}
 
Example 8
Source File: BenchmarkSortedRangeSet.java    From presto with Apache License 2.0 5 votes vote down vote up
@Setup(Level.Iteration)
public void init()
{
    ranges = new ArrayList<>();

    int factor = 0;
    for (int i = 0; i < 10000; i++) {
        long from = ThreadLocalRandom.current().nextLong(100) + factor * 100;
        long to = ThreadLocalRandom.current().nextLong(100) + (factor + 1) * 100;
        factor++;

        ranges.add(new Range(Marker.above(BIGINT, from), Marker.below(BIGINT, to)));
    }
}
 
Example 9
Source File: PropagatorContextInjectBenchmark.java    From opentelemetry-java with Apache License 2.0 4 votes vote down vote up
@TearDown(Level.Iteration)
public void tearDown() {
  this.contextToTest = spanContexts.get(++iteration % spanContexts.size());
}
 
Example 10
Source File: DefaultTracerBenchmarks.java    From opentelemetry-java with Apache License 2.0 4 votes vote down vote up
@TearDown(Level.Iteration)
public void tearDown() {
  if (span != null) {
    span.end();
  }
}
 
Example 11
Source File: SymSpellIndexBenchMark.java    From customized-symspell with MIT License 4 votes vote down vote up
@TearDown(Level.Iteration)
public void tearDown() {
  spellChecker = null;
}
 
Example 12
Source File: PutBenchmark.java    From Oak with Apache License 2.0 4 votes vote down vote up
@TearDown(Level.Iteration)
public void closeOak() {
    oakMap.close();
}
 
Example 13
Source File: ConcurrentSubscriptionReentrantBenchmark.java    From servicetalk with Apache License 2.0 4 votes vote down vote up
@Setup(Level.Iteration)
public void setup() {
    innerSubscription = new InnerSubscription(stackDepth);
    subscription = ConcurrentSubscription.wrap(innerSubscription);
    innerSubscription.outerSubscription(subscription);
}
 
Example 14
Source File: RegionBSPTree3DPerformance.java    From commons-geometry with Apache License 2.0 4 votes vote down vote up
/** Set up the instance for the benchmark. */
@Setup(Level.Iteration)
public void setup() {
    boundaries = computeBoundaries();
}
 
Example 15
Source File: FolderRoleBenchmark.java    From folder-auth-plugin with MIT License 4 votes vote down vote up
@Setup(Level.Iteration)
public void setup() {
    SecurityContext securityContext = SecurityContextHolder.getContext();
    securityContext.setAuthentication(Objects.requireNonNull(User.getById("user33", true)).impersonate());
}
 
Example 16
Source File: CirclePerformance.java    From commons-geometry with Apache License 2.0 4 votes vote down vote up
/** Set up the instance for the benchmark. */
@Setup(Level.Iteration)
public void setup() {
    circle = randomCircle(RandomSource.create(RandomSource.XO_RO_SHI_RO_128_PP));
}
 
Example 17
Source File: ConnectableBufferOutputStreamBenchmark.java    From servicetalk with Apache License 2.0 4 votes vote down vote up
@Setup(Level.Iteration)
public void clean() {
    producedBytes = 0;
    flush = 0;
}
 
Example 18
Source File: StreamingResponseBandwidthBenchmark.java    From grpc-nebula-java with Apache License 2.0 4 votes vote down vote up
@Setup(Level.Iteration)
public void clean() {
  callCounter.set(0);
}
 
Example 19
Source File: FlowControlledMessagesPerSecondBenchmark.java    From grpc-nebula-java with Apache License 2.0 4 votes vote down vote up
@Setup(Level.Iteration)
public void clean() {
  callCounter.set(0);
}
 
Example 20
Source File: BenchmarkChunkManager.java    From hadoop-ozone with Apache License 2.0 4 votes vote down vote up
@TearDown(Level.Iteration)
public void cleanup() {
  FileUtils.deleteQuietly(dir);
}