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

Function BenchmarkASCIIValidation

cpp/src/arrow/util/utf8_util_benchmark.cc:82–99  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

80}
81
82static void BenchmarkASCIIValidation(
83 benchmark::State& state, // NOLINT non-const reference
84 const std::string& s, bool expected) {
85 auto data = reinterpret_cast<const uint8_t*>(s.data());
86 auto data_size = static_cast<int64_t>(s.size());
87
88 bool b = ValidateAsciiNoInline(data, data_size);
89 if (b != expected) {
90 std::cerr << "Unexpected validation result" << std::endl;
91 std::abort();
92 }
93
94 while (state.KeepRunning()) {
95 bool b = ValidateAsciiNoInline(data, data_size);
96 benchmark::DoNotOptimize(b);
97 }
98 state.SetBytesProcessed(state.iterations() * s.size());
99}
100
101static void ValidateTinyAscii(benchmark::State& state) { // NOLINT non-const reference
102 BenchmarkASCIIValidation(state, tiny_valid_ascii, true);

Callers 3

ValidateTinyAsciiFunction · 0.85
ValidateSmallAsciiFunction · 0.85
ValidateLargeAsciiFunction · 0.85

Calls 3

ValidateAsciiNoInlineFunction · 0.85
dataMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected