Home / Function/ setup() — netty Function Reference

setup() — netty Function Reference

Architecture documentation for the setup() function in ByteBufAllocatorAllocPatternBenchmark.java from the netty codebase.

Function java Buffer Search called by 1

Entity Profile

Dependency Diagram

graph TD
  5434ee01_3cf8_3416_b95e_92d02dcc98a8["setup()"]
  2b9d2c55_b3ab_2241_3c94_2c28d1742399["AllocationPatternState"]
  5434ee01_3cf8_3416_b95e_92d02dcc98a8 -->|defined in| 2b9d2c55_b3ab_2241_3c94_2c28d1742399
  08c39d59_9fc8_19d0_9a47_4c56e7a2655c["setupAllocatorAndPollute()"]
  08c39d59_9fc8_19d0_9a47_4c56e7a2655c -->|calls| 5434ee01_3cf8_3416_b95e_92d02dcc98a8
  style 5434ee01_3cf8_3416_b95e_92d02dcc98a8 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

microbench/src/main/java/io/netty/microbench/buffer/ByteBufAllocatorAllocPatternBenchmark.java lines 85–103

        @Setup
        public void setup(ByteBufAllocatorAllocPatternBenchmark benchmark) {
            this.allocator = benchmark.allocator;
            releaseIndexes = new int[MAX_LIVE_BUFFERS];
            sizes = new int[MathUtil.findNextPositivePowerOfTwo(FLATTEND_SIZE_ARRAY.length)];
            SplittableRandom rand = new SplittableRandom(SEED);
            // Pre-generate the to be released index.
            for (int i = 0; i < releaseIndexes.length; i++) {
                releaseIndexes[i] = rand.nextInt(releaseIndexes.length);
            }
            // Shuffle the `flattendSizeArray` to `sizes`.
            for (int i = 0; i < sizes.length; i++) {
                int sizeIndex = rand.nextInt(FLATTEND_SIZE_ARRAY.length);
                sizes[i] = FLATTEND_SIZE_ARRAY[sizeIndex];
            }
            nextReleaseIndex = 0;
            nextSizeIndex = 0;
            buffers = new ByteBuf[MAX_LIVE_BUFFERS];
        }

Domain

Subdomains

Frequently Asked Questions

What does setup() do?
setup() is a function in the netty codebase, defined in microbench/src/main/java/io/netty/microbench/buffer/ByteBufAllocatorAllocPatternBenchmark.java.
Where is setup() defined?
setup() is defined in microbench/src/main/java/io/netty/microbench/buffer/ByteBufAllocatorAllocPatternBenchmark.java at line 85.
What calls setup()?
setup() is called by 1 function(s): setupAllocatorAndPollute.

Analyze Your Own Codebase

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

Try Supermodel Free