Home / Class/ ByteBufAllocatorConcurrentBenchmark Class — netty Architecture

ByteBufAllocatorConcurrentBenchmark Class — netty Architecture

Architecture documentation for the ByteBufAllocatorConcurrentBenchmark class in ByteBufAllocatorConcurrentBenchmark.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  9e4c3121_ffd6_1868_717a_735f62e48398["ByteBufAllocatorConcurrentBenchmark"]
  92f2b47c_f7df_a526_2b7e_6489b78ded9e["ByteBufAllocatorConcurrentBenchmark.java"]
  9e4c3121_ffd6_1868_717a_735f62e48398 -->|defined in| 92f2b47c_f7df_a526_2b7e_6489b78ded9e
  5c1abe8f_82e5_4655_caec_4cbd86ec1348["allocateReleaseUnpooled()"]
  9e4c3121_ffd6_1868_717a_735f62e48398 -->|method| 5c1abe8f_82e5_4655_caec_4cbd86ec1348
  662b64e0_8f57_bdce_1359_4b5b9d0f376c["allocateReleasePooled()"]
  9e4c3121_ffd6_1868_717a_735f62e48398 -->|method| 662b64e0_8f57_bdce_1359_4b5b9d0f376c
  632d4b44_cd6e_21c1_ab0c_6c28bef9359e["allocateReleaseAdaptive()"]
  9e4c3121_ffd6_1868_717a_735f62e48398 -->|method| 632d4b44_cd6e_21c1_ab0c_6c28bef9359e

Relationship Graph

Source Code

microbench/src/main/java/io/netty/microbench/buffer/ByteBufAllocatorConcurrentBenchmark.java lines 31–63

@State(Scope.Benchmark)
@Warmup(iterations = 10, time = 1)
@Measurement(iterations = 10, time = 1)
@Threads(8)
public class ByteBufAllocatorConcurrentBenchmark  extends AbstractMicrobenchmark {

    private static final ByteBufAllocator unpooledAllocator = new UnpooledByteBufAllocator(true, true);
    private static final ByteBufAllocator pooledAllocator = PooledByteBufAllocator.DEFAULT;
    private static final ByteBufAllocator adaptiveAllocator = new AdaptiveByteBufAllocator();

    @Param({
            "00064",
            "00256",
            "01024",
            "04096",
    })
    public int size;

    @Benchmark
    public boolean allocateReleaseUnpooled() {
        return unpooledAllocator.directBuffer(size).release();
    }

    @Benchmark
    public boolean allocateReleasePooled() {
        return pooledAllocator.directBuffer(size).release();
    }

    @Benchmark
    public boolean allocateReleaseAdaptive() {
        return adaptiveAllocator.directBuffer(size).release();
    }
}

Frequently Asked Questions

What is the ByteBufAllocatorConcurrentBenchmark class?
ByteBufAllocatorConcurrentBenchmark is a class in the netty codebase, defined in microbench/src/main/java/io/netty/microbench/buffer/ByteBufAllocatorConcurrentBenchmark.java.
Where is ByteBufAllocatorConcurrentBenchmark defined?
ByteBufAllocatorConcurrentBenchmark is defined in microbench/src/main/java/io/netty/microbench/buffer/ByteBufAllocatorConcurrentBenchmark.java at line 31.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free