Home / Class/ CodecOutputListBenchmark Class — netty Architecture

CodecOutputListBenchmark Class — netty Architecture

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

Entity Profile

Dependency Diagram

graph TD
  8beb3443_fb44_b9e2_6e60_33fd76b7a481["CodecOutputListBenchmark"]
  b2902e8e_56ef_7ce0_4a6d_21b052a1bd2e["CodecOutputListBenchmark.java"]
  8beb3443_fb44_b9e2_6e60_33fd76b7a481 -->|defined in| b2902e8e_56ef_7ce0_4a6d_21b052a1bd2e
  988415a9_b18d_e8f7_f8a4_145c699002a1["destroy()"]
  8beb3443_fb44_b9e2_6e60_33fd76b7a481 -->|method| 988415a9_b18d_e8f7_f8a4_145c699002a1
  537be5c9_80a8_1762_ab17_b85a94d50bb1["codecOutList()"]
  8beb3443_fb44_b9e2_6e60_33fd76b7a481 -->|method| 537be5c9_80a8_1762_ab17_b85a94d50bb1
  5a1ed49e_9dfc_2fef_8430_b239db280991["recyclableArrayList()"]
  8beb3443_fb44_b9e2_6e60_33fd76b7a481 -->|method| 5a1ed49e_9dfc_2fef_8430_b239db280991
  d7cb3e07_d6c8_7a46_874e_96a51781a035["arrayList()"]
  8beb3443_fb44_b9e2_6e60_33fd76b7a481 -->|method| d7cb3e07_d6c8_7a46_874e_96a51781a035
  b6722041_8aad_aa20_755b_a75c85835166["benchmarkAddAndClear()"]
  8beb3443_fb44_b9e2_6e60_33fd76b7a481 -->|method| b6722041_8aad_aa20_755b_a75c85835166

Relationship Graph

Source Code

microbench/src/main/java/io/netty/handler/codec/CodecOutputListBenchmark.java lines 29–70

@State(Scope.Benchmark)
public class CodecOutputListBenchmark extends AbstractMicrobenchmark {

    private static final Object ELEMENT = new Object();
    private CodecOutputList codecOutputList;
    private RecyclableArrayList recycleableArrayList;
    private List<Object> arrayList;

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

    @TearDown
    public void destroy() {
        codecOutputList.recycle();
        recycleableArrayList.recycle();
    }

    @Benchmark
    public void codecOutList() {
        codecOutputList = CodecOutputList.newInstance();
        benchmarkAddAndClear(codecOutputList, elements);
    }

    @Benchmark
    public void recyclableArrayList() {
        recycleableArrayList = RecyclableArrayList.newInstance(16);
        benchmarkAddAndClear(recycleableArrayList, elements);
    }

    @Benchmark
    public void arrayList() {
        arrayList = new ArrayList<Object>(16);
        benchmarkAddAndClear(arrayList, elements);
    }

    private static void benchmarkAddAndClear(List<Object> list, int elements) {
        for (int i = 0; i < elements; i++) {
            list.add(ELEMENT);
        }
        list.clear();
    }
}

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free