Home / Class/ AbstractByteBufGetCharSequenceBenchmark Class — netty Architecture

AbstractByteBufGetCharSequenceBenchmark Class — netty Architecture

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

Entity Profile

Dependency Diagram

graph TD
  3c22d637_60c0_7575_bb26_6df4711888f9["AbstractByteBufGetCharSequenceBenchmark"]
  10c8755a_065a_38c1_c0ef_5adfa9694f2a["AbstractByteBufGetCharSequenceBenchmark.java"]
  3c22d637_60c0_7575_bb26_6df4711888f9 -->|defined in| 10c8755a_065a_38c1_c0ef_5adfa9694f2a
  6e8f18e1_a773_f4f9_488a_385151b8d4be["jvmArgs()"]
  3c22d637_60c0_7575_bb26_6df4711888f9 -->|method| 6e8f18e1_a773_f4f9_488a_385151b8d4be
  eb4e0f35_65db_209a_36bb_daa2cd1fee25["setup()"]
  3c22d637_60c0_7575_bb26_6df4711888f9 -->|method| eb4e0f35_65db_209a_36bb_daa2cd1fee25
  b5efbd6a_7110_9823_264e_75fad92271c7["teardown()"]
  3c22d637_60c0_7575_bb26_6df4711888f9 -->|method| b5efbd6a_7110_9823_264e_75fad92271c7
  d8ffde94_bdd3_bbdf_ed03_ddb64e147f04["getCharSequence()"]
  3c22d637_60c0_7575_bb26_6df4711888f9 -->|method| d8ffde94_bdd3_bbdf_ed03_ddb64e147f04
  0bb377a2_dbe7_8fa7_9986_6034004ad1f1["setCharSequence()"]
  3c22d637_60c0_7575_bb26_6df4711888f9 -->|method| 0bb377a2_dbe7_8fa7_9986_6034004ad1f1
  22da11b9_c70a_a2af_48b0_a86009e47d0b["getCharSequenceOld()"]
  3c22d637_60c0_7575_bb26_6df4711888f9 -->|method| 22da11b9_c70a_a2af_48b0_a86009e47d0b
  f1a9c379_be7a_8614_3d11_a4a2bf48082c["traverse()"]
  3c22d637_60c0_7575_bb26_6df4711888f9 -->|method| f1a9c379_be7a_8614_3d11_a4a2bf48082c

Relationship Graph

Source Code

microbench/src/main/java/io/netty/buffer/AbstractByteBufGetCharSequenceBenchmark.java lines 30–166

@Warmup(iterations = 10, time = 1, timeUnit = TimeUnit.SECONDS)
@Measurement(iterations = 10, time = 1, timeUnit = TimeUnit.SECONDS)
public class AbstractByteBufGetCharSequenceBenchmark extends AbstractMicrobenchmark {
    private static final AdaptiveByteBufAllocator ADAPTIVE_ALLOC = new AdaptiveByteBufAllocator();

    public enum ByteBufType {
        DIRECT {
            @Override
            ByteBuf newBuffer(byte[] bytes, int length) {
                ByteBuf buffer = Unpooled.directBuffer(length);
                buffer.writeBytes(bytes, 0, length);
                return buffer;
            }
        },
        HEAP_OFFSET {
            @Override
            ByteBuf newBuffer(byte[] bytes, int length) {
                return Unpooled.wrappedBuffer(bytes, 1, length);
            }
        },
        HEAP {
            @Override
            ByteBuf newBuffer(byte[] bytes, int length) {
                return Unpooled.wrappedBuffer(bytes, 0, length);
            }
        },
        POOLED_HEAP {
            @Override
            ByteBuf newBuffer(byte[] bytes, int length) {
                return PooledByteBufAllocator.DEFAULT.heapBuffer(length).writeBytes(bytes, 0, length);
            }
        },
        POOLED_DIRECT {
            @Override
            ByteBuf newBuffer(byte[] bytes, int length) {
                return PooledByteBufAllocator.DEFAULT.directBuffer(length).writeBytes(bytes, 0, length);
            }
        },
        ADAPTIVE_HEAP {
            @Override
            ByteBuf newBuffer(byte[] bytes, int length) {
                return ADAPTIVE_ALLOC.heapBuffer(length).writeBytes(bytes, 0, length);
            }
        },
        ADAPTIVE_DIRECT {
            @Override
            ByteBuf newBuffer(byte[] bytes, int length) {
                return ADAPTIVE_ALLOC.directBuffer(length).writeBytes(bytes, 0, length);
            }
        },
        COMPOSITE {
            @Override
            ByteBuf newBuffer(byte[] bytes, int length) {
                CompositeByteBuf buffer = Unpooled.compositeBuffer();
                int offset = 0;
                // 8 buffers per composite.
                int capacity = length / 8;

                while (length > 0) {
                    buffer.addComponent(true, Unpooled.wrappedBuffer(bytes, offset, Math.min(length, capacity)));
                    length -= capacity;
                    offset += capacity;
                }
                return buffer;
            }
        }
        ;
        abstract ByteBuf newBuffer(byte[] bytes, int length);
    }

    @Param({
            "8",
            "64",
            "1024",
            "10240",
            "1073741824"
    })
    public int size;

    @Param({
            "US-ASCII",

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free