File tree Expand file tree Collapse file tree 5 files changed +34
-10
lines changed
performance/src/main/java/org/apache/arrow/vector Expand file tree Collapse file tree 5 files changed +34
-10
lines changed Original file line number Diff line number Diff line change 1+ /*
2+ * Licensed to the Apache Software Foundation (ASF) under one or more
3+ * contributor license agreements. See the NOTICE file distributed with
4+ * this work for additional information regarding copyright ownership.
5+ * The ASF licenses this file to You under the Apache License, Version 2.0
6+ * (the "License"); you may not use this file except in compliance with
7+ * the License. You may obtain a copy of the License at
8+ *
9+ * http://www.apache.org/licenses/LICENSE-2.0
10+ *
11+ * Unless required by applicable law or agreed to in writing, software
12+ * distributed under the License is distributed on an "AS IS" BASIS,
13+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+ * See the License for the specific language governing permissions and
15+ * limitations under the License.
16+ */
17+ package org .apache .arrow .vector ;
18+
19+ public class VariableWidthVectorBenchmarkConstants {
20+ public static final String SHORT_VALUE = "InlineValue" ;
21+ public static final String LONG_VALUE = VariableWidthVectorBenchmarks .class .getName ();
22+ }
Original file line number Diff line number Diff line change @@ -47,7 +47,7 @@ public class VariableWidthVectorBenchmarks {
4747
4848 private static final int ALLOCATOR_CAPACITY = 1024 * 1024 ;
4949
50- private static byte [] bytes = VariableWidthVectorBenchmarks . class . getName () .getBytes ();
50+ private static byte [] bytes = VariableWidthVectorBenchmarkConstants . LONG_VALUE .getBytes ();
5151 private ArrowBuf arrowBuff ;
5252
5353 private BufferAllocator allocator ;
Original file line number Diff line number Diff line change 1616 */
1717package org .apache .arrow .vector ;
1818
19+ import java .util .concurrent .TimeUnit ;
1920import org .apache .arrow .memory .ArrowBuf ;
2021import org .apache .arrow .memory .BufferAllocator ;
2122import org .apache .arrow .memory .RootAllocator ;
3536import org .openjdk .jmh .runner .options .Options ;
3637import org .openjdk .jmh .runner .options .OptionsBuilder ;
3738
38- import java .util .concurrent .TimeUnit ;
39-
4039/** Benchmarks for {@link BaseVariableWidthVector}. */
4140@ State (Scope .Benchmark )
4241public class VariableWidthVectorInlineValueBenchmarks {
@@ -48,7 +47,7 @@ public class VariableWidthVectorInlineValueBenchmarks {
4847
4948 private static final int ALLOCATOR_CAPACITY = 1024 * 1024 ;
5049
51- private static final byte [] bytes = "InlineValue" .getBytes ();
50+ private static final byte [] bytes = VariableWidthVectorBenchmarkConstants . SHORT_VALUE .getBytes ();
5251 private ArrowBuf arrowBuff ;
5352
5453 private BufferAllocator allocator ;
@@ -121,7 +120,9 @@ public int setSafeFromNullableVarcharHolder() {
121120 public static void main (String [] args ) throws RunnerException {
122121 Options opt =
123122 new OptionsBuilder ()
124- .include (VariableWidthVectorInlineValueBenchmarks .class .getSimpleName () + ".setSafeFromArray" )
123+ .include (
124+ VariableWidthVectorInlineValueBenchmarks .class .getSimpleName ()
125+ + ".setSafeFromArray" )
125126 .forks (1 )
126127 .build ();
127128
Original file line number Diff line number Diff line change @@ -47,7 +47,7 @@ public class VariableWidthViewVectorBenchmarks {
4747
4848 private static final int ALLOCATOR_CAPACITY = 1024 * 1024 ;
4949
50- private static byte [] bytes = VariableWidthVectorBenchmarks . class . getName () .getBytes ();
50+ private static byte [] bytes = VariableWidthVectorBenchmarkConstants . LONG_VALUE .getBytes ();
5151 private ArrowBuf arrowBuff ;
5252
5353 private BufferAllocator allocator ;
Original file line number Diff line number Diff line change 1616 */
1717package org .apache .arrow .vector ;
1818
19+ import java .util .concurrent .TimeUnit ;
1920import org .apache .arrow .memory .ArrowBuf ;
2021import org .apache .arrow .memory .BufferAllocator ;
2122import org .apache .arrow .memory .RootAllocator ;
3536import org .openjdk .jmh .runner .options .Options ;
3637import org .openjdk .jmh .runner .options .OptionsBuilder ;
3738
38- import java .util .concurrent .TimeUnit ;
39-
4039/** Benchmarks for {@link BaseVariableWidthVector}. */
4140@ State (Scope .Benchmark )
4241public class VariableWidthViewVectorInlineValueBenchmarks {
@@ -48,7 +47,7 @@ public class VariableWidthViewVectorInlineValueBenchmarks {
4847
4948 private static final int ALLOCATOR_CAPACITY = 1024 * 1024 ;
5049
51- private static byte [] bytes = "InlineValue" .getBytes ();
50+ private static byte [] bytes = VariableWidthVectorBenchmarkConstants . SHORT_VALUE .getBytes ();
5251 private ArrowBuf arrowBuff ;
5352
5453 private BufferAllocator allocator ;
@@ -121,7 +120,9 @@ public int setSafeFromNullableVarcharHolder() {
121120 public static void main (String [] args ) throws RunnerException {
122121 Options opt =
123122 new OptionsBuilder ()
124- .include (VariableWidthViewVectorInlineValueBenchmarks .class .getSimpleName () + ".setSafeFromArray" )
123+ .include (
124+ VariableWidthViewVectorInlineValueBenchmarks .class .getSimpleName ()
125+ + ".setSafeFromArray" )
125126 .forks (1 )
126127 .build ();
127128
You can’t perform that action at this time.
0 commit comments