performance/src/main/java/org/apache/arrow/vector/VariableWidthVectorBenchmarks.java [65:103]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    vector.allocateNew(VECTOR_CAPACITY, VECTOR_LENGTH);
    arrowBuff = allocator.buffer(VECTOR_LENGTH);
    arrowBuff.setBytes(0, bytes, 0, bytes.length);
  }

  /** Tear down benchmarks. */
  @TearDown(Level.Iteration)
  public void tearDown() {
    arrowBuff.close();
    vector.close();
    allocator.close();
  }

  /**
   * Test {@link BaseVariableWidthVector#getValueCapacity()}.
   *
   * @return useless. To avoid DCE by JIT.
   */
  @Benchmark
  @BenchmarkMode(Mode.AverageTime)
  @OutputTimeUnit(TimeUnit.NANOSECONDS)
  public int getValueCapacity() {
    return vector.getValueCapacity();
  }

  @Benchmark
  @BenchmarkMode(Mode.AverageTime)
  @OutputTimeUnit(TimeUnit.MILLISECONDS)
  public int setSafeFromArray() {
    for (int i = 0; i < 500; ++i) {
      vector.setSafe(i * step, bytes);
    }
    return vector.getBufferSize();
  }

  @Benchmark
  @BenchmarkMode(Mode.AverageTime)
  @OutputTimeUnit(TimeUnit.MILLISECONDS)
  public int setSafeFromNullableVarcharHolder() {
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



performance/src/main/java/org/apache/arrow/vector/VariableWidthViewVectorBenchmarks.java [65:103]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    vector.allocateNew(VECTOR_CAPACITY, VECTOR_LENGTH);
    arrowBuff = allocator.buffer(VECTOR_LENGTH);
    arrowBuff.setBytes(0, bytes, 0, bytes.length);
  }

  /** Tear down benchmarks. */
  @TearDown(Level.Iteration)
  public void tearDown() {
    arrowBuff.close();
    vector.close();
    allocator.close();
  }

  /**
   * Test {@link BaseVariableWidthVector#getValueCapacity()}.
   *
   * @return useless. To avoid DCE by JIT.
   */
  @Benchmark
  @BenchmarkMode(Mode.AverageTime)
  @OutputTimeUnit(TimeUnit.NANOSECONDS)
  public int getValueCapacity() {
    return vector.getValueCapacity();
  }

  @Benchmark
  @BenchmarkMode(Mode.AverageTime)
  @OutputTimeUnit(TimeUnit.MILLISECONDS)
  public int setSafeFromArray() {
    for (int i = 0; i < 500; ++i) {
      vector.setSafe(i * step, bytes);
    }
    return vector.getBufferSize();
  }

  @Benchmark
  @BenchmarkMode(Mode.AverageTime)
  @OutputTimeUnit(TimeUnit.MILLISECONDS)
  public int setSafeFromNullableVarcharHolder() {
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



