|
23 | 23 | import org.apache.arrow.vector.holders.NullableViewVarCharHolder; |
24 | 24 | import org.openjdk.jmh.annotations.Benchmark; |
25 | 25 | import org.openjdk.jmh.annotations.BenchmarkMode; |
| 26 | +import org.openjdk.jmh.annotations.Fork; |
26 | 27 | import org.openjdk.jmh.annotations.Level; |
27 | 28 | import org.openjdk.jmh.annotations.Mode; |
28 | 29 | import org.openjdk.jmh.annotations.OutputTimeUnit; |
|
31 | 32 | import org.openjdk.jmh.annotations.Setup; |
32 | 33 | import org.openjdk.jmh.annotations.State; |
33 | 34 | import org.openjdk.jmh.annotations.TearDown; |
| 35 | +import org.openjdk.jmh.annotations.Warmup; |
34 | 36 | import org.openjdk.jmh.runner.Runner; |
35 | 37 | import org.openjdk.jmh.runner.RunnerException; |
36 | 38 | import org.openjdk.jmh.runner.options.Options; |
@@ -58,17 +60,18 @@ public class VariableWidthViewVectorInlineValueBenchmarks { |
58 | 60 | private int step; |
59 | 61 |
|
60 | 62 | /** Setup benchmarks. */ |
61 | | - @Setup(Level.Iteration) |
| 63 | + @Setup(Level.Invocation) |
62 | 64 | public void prepare() { |
63 | 65 | allocator = new RootAllocator(); |
64 | 66 | vector = new ViewVarCharVector("vector", allocator); |
65 | 67 | vector.allocateNew(VECTOR_CAPACITY, VECTOR_LENGTH); |
| 68 | + vector.zeroVector(); |
66 | 69 | arrowBuff = allocator.buffer(VECTOR_LENGTH); |
67 | 70 | arrowBuff.setBytes(0, bytes, 0, bytes.length); |
68 | 71 | } |
69 | 72 |
|
70 | 73 | /** Tear down benchmarks. */ |
71 | | - @TearDown(Level.Iteration) |
| 74 | + @TearDown(Level.Invocation) |
72 | 75 | public void tearDown() { |
73 | 76 | arrowBuff.close(); |
74 | 77 | vector.close(); |
|
0 commit comments