1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package io.netty.buffer;
17
18 import io.netty.microbench.util.AbstractMicrobenchmark;
19 import org.openjdk.jmh.annotations.Param;
20
21 public abstract class AbstractByteBufNoCleanerBenchmark extends AbstractMicrobenchmark {
22
23 public enum ByteBufType {
24 UNPOOLED_NO_CLEANER {
25 @Override
26 ByteBuf newBuffer(int initialCapacity) {
27 return new UnpooledUnsafeNoCleanerDirectByteBuf(
28 UnpooledByteBufAllocator.DEFAULT, initialCapacity, Integer.MAX_VALUE);
29 }
30 },
31 UNPOOLED {
32 @Override
33 ByteBuf newBuffer(int initialCapacity) {
34 return new UnpooledUnsafeDirectByteBuf(
35 UnpooledByteBufAllocator.DEFAULT, initialCapacity, Integer.MAX_VALUE);
36 }
37 };
38 abstract ByteBuf newBuffer(int initialCapacity);
39 }
40
41 @Param
42 public ByteBufType bufferType;
43 }