Skip to content

Commit de73f9d

Browse files
committed
setZero in prepare
1 parent 0ff5248 commit de73f9d

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

performance/src/main/java/org/apache/arrow/vector/VariableWidthViewVectorInlineValueBenchmarks.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
import org.apache.arrow.vector.holders.NullableViewVarCharHolder;
2424
import org.openjdk.jmh.annotations.Benchmark;
2525
import org.openjdk.jmh.annotations.BenchmarkMode;
26+
import org.openjdk.jmh.annotations.Fork;
2627
import org.openjdk.jmh.annotations.Level;
2728
import org.openjdk.jmh.annotations.Mode;
2829
import org.openjdk.jmh.annotations.OutputTimeUnit;
@@ -31,6 +32,7 @@
3132
import org.openjdk.jmh.annotations.Setup;
3233
import org.openjdk.jmh.annotations.State;
3334
import org.openjdk.jmh.annotations.TearDown;
35+
import org.openjdk.jmh.annotations.Warmup;
3436
import org.openjdk.jmh.runner.Runner;
3537
import org.openjdk.jmh.runner.RunnerException;
3638
import org.openjdk.jmh.runner.options.Options;
@@ -58,17 +60,18 @@ public class VariableWidthViewVectorInlineValueBenchmarks {
5860
private int step;
5961

6062
/** Setup benchmarks. */
61-
@Setup(Level.Iteration)
63+
@Setup(Level.Invocation)
6264
public void prepare() {
6365
allocator = new RootAllocator();
6466
vector = new ViewVarCharVector("vector", allocator);
6567
vector.allocateNew(VECTOR_CAPACITY, VECTOR_LENGTH);
68+
vector.zeroVector();
6669
arrowBuff = allocator.buffer(VECTOR_LENGTH);
6770
arrowBuff.setBytes(0, bytes, 0, bytes.length);
6871
}
6972

7073
/** Tear down benchmarks. */
71-
@TearDown(Level.Iteration)
74+
@TearDown(Level.Invocation)
7275
public void tearDown() {
7376
arrowBuff.close();
7477
vector.close();

0 commit comments

Comments
 (0)