@@ -25,37 +25,42 @@ namespace arrow {
2525
2626constexpr int64_t kFinalSize = 256 ;
2727
28- static void BM_BuildPrimitiveArrayNoNulls (benchmark::State& state) { // NOLINT non-const reference
29- // 1 MiB block
28+ static void BM_BuildPrimitiveArrayNoNulls (
29+ benchmark::State& state) { // NOLINT non-const reference
30+ // 2 MiB block
3031 std::vector<int64_t > data (256 * 1024 , 100 );
3132 while (state.KeepRunning ()) {
3233 Int64Builder builder (default_memory_pool (), arrow::int64 ());
3334 for (int i = 0 ; i < kFinalSize ; i++) {
34- // Build up an array of 256 MiB in size
35+ // Build up an array of 512 MiB in size
3536 builder.Append (data.data (), data.size (), nullptr );
3637 }
3738 std::shared_ptr<Array> out;
3839 builder.Finish (&out);
3940 }
40- state.SetBytesProcessed (state.iterations () * data.size () * sizeof (int64_t ) * kFinalSize );
41+ state.SetBytesProcessed (
42+ state.iterations () * data.size () * sizeof (int64_t ) * kFinalSize );
4143}
4244
43- BENCHMARK (BM_BuildPrimitiveArrayNoNulls)->Repetitions (3 )->Unit(benchmark::kMillisecond );;
45+ BENCHMARK (BM_BuildPrimitiveArrayNoNulls)->Repetitions (3 )->Unit(benchmark::kMillisecond );
46+ ;
4447
45- static void BM_BuildVectorNoNulls (benchmark::State& state) { // NOLINT non-const reference
46- // 1 MiB block
48+ static void BM_BuildVectorNoNulls (
49+ benchmark::State& state) { // NOLINT non-const reference
50+ // 2 MiB block
4751 std::vector<int64_t > data (256 * 1024 , 100 );
4852 while (state.KeepRunning ()) {
4953 std::vector<int64_t > builder;
5054 for (int i = 0 ; i < kFinalSize ; i++) {
51- // Build up an array of 256 MiB in size
55+ // Build up an array of 512 MiB in size
5256 builder.insert (builder.end (), data.cbegin (), data.cend ());
5357 }
5458 }
55- state.SetBytesProcessed (state.iterations () * data.size () * sizeof (int64_t ) * kFinalSize );
59+ state.SetBytesProcessed (
60+ state.iterations () * data.size () * sizeof (int64_t ) * kFinalSize );
5661}
5762
58- BENCHMARK (BM_BuildVectorNoNulls)->Repetitions (3 )->Unit(benchmark::kMillisecond );;
63+ BENCHMARK (BM_BuildVectorNoNulls)->Repetitions (3 )->Unit(benchmark::kMillisecond );
64+ ;
5965
6066} // namespace arrow
61-
0 commit comments