MCPcopy Create free account
hub / github.com/apache/arrow / BenchmarkConversion

Function BenchmarkConversion

cpp/src/arrow/csv/converter_benchmark.cc:87–103  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

85}
86
87static void BenchmarkConversion(benchmark::State& state, // NOLINT non-const reference
88 BlockParser& parser,
89 const std::shared_ptr<DataType>& type,
90 ConvertOptions options) {
91 std::shared_ptr<Converter> converter =
92 *Converter::Make(type, options, memory_tracker.memory_pool());
93
94 while (state.KeepRunning()) {
95 auto converted = *converter->Convert(parser, 0 /* col_index */);
96 if (converted->length() != parser.num_rows()) {
97 std::cerr << "Conversion incomplete\n";
98 std::abort();
99 }
100 }
101
102 state.SetItemsProcessed(state.iterations() * parser.num_rows());
103}
104
105constexpr size_t num_rows = 10000;
106

Callers 6

Int64ConversionFunction · 0.85
FloatConversionFunction · 0.85
Decimal128ConversionFunction · 0.85
StringConversionFunction · 0.85

Calls 5

MakeFunction · 0.50
memory_poolMethod · 0.45
ConvertMethod · 0.45
lengthMethod · 0.45
num_rowsMethod · 0.45

Tested by

no test coverage detected