Home / Class/ AdvancedCodecOutputListBenchmark Class — netty Architecture

AdvancedCodecOutputListBenchmark Class — netty Architecture

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

Entity Profile

Dependency Diagram

graph TD
  76c32ea3_df68_7d79_6b41_9262fb48c248["AdvancedCodecOutputListBenchmark"]
  237ec6b9_9a00_bd9e_7977_b011e9a345e2["AdvancedCodecOutputListBenchmark.java"]
  76c32ea3_df68_7d79_6b41_9262fb48c248 -->|defined in| 237ec6b9_9a00_bd9e_7977_b011e9a345e2
  d2d12b9f_775c_0979_8312_af626cc61aae["codecOutListAllocRecycle()"]
  76c32ea3_df68_7d79_6b41_9262fb48c248 -->|method| d2d12b9f_775c_0979_8312_af626cc61aae
  26d64d9b_c8e1_bca9_7364_f1cf9ab8108d["benchmark()"]
  76c32ea3_df68_7d79_6b41_9262fb48c248 -->|method| 26d64d9b_c8e1_bca9_7364_f1cf9ab8108d

Relationship Graph

Source Code

microbench/src/main/java/io/netty/handler/codec/AdvancedCodecOutputListBenchmark.java lines 25–53

@State(Scope.Benchmark)
@Threads(16)
public class AdvancedCodecOutputListBenchmark extends AbstractMicrobenchmark {

    private static final Object ELEMENT = new Object();

    @Param({ "1", "4" })
    public int elements;

    @Benchmark
    public boolean codecOutListAllocRecycle() {
        return benchmark(elements, CodecOutputList.newInstance(), CodecOutputList.newInstance(),
                CodecOutputList.newInstance(), CodecOutputList.newInstance());
    }

    private static boolean benchmark(int elements, CodecOutputList list1, CodecOutputList list2,
                                     CodecOutputList list3, CodecOutputList list4) {
        return (benchmark(elements, list1) == benchmark(elements, list2)) ==
                (benchmark(elements, list3) == benchmark(elements, list4));
    }

    private static boolean benchmark(int elements, CodecOutputList list) {
        for (int i = 0; i < elements; ++i) {
            list.add(ELEMENT);
        }
        list.recycle();
        return list.insertSinceRecycled();
    }
}

Frequently Asked Questions

What is the AdvancedCodecOutputListBenchmark class?
AdvancedCodecOutputListBenchmark is a class in the netty codebase, defined in microbench/src/main/java/io/netty/handler/codec/AdvancedCodecOutputListBenchmark.java.
Where is AdvancedCodecOutputListBenchmark defined?
AdvancedCodecOutputListBenchmark is defined in microbench/src/main/java/io/netty/handler/codec/AdvancedCodecOutputListBenchmark.java at line 25.

Analyze Your Own Codebase

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

Try Supermodel Free