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

Function BenchmarkUTF8Validation

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

Source from the content-addressed store, hash-verified

60}
61
62static void BenchmarkUTF8Validation(
63 benchmark::State& state, // NOLINT non-const reference
64 const std::string& s, bool expected) {
65 auto data = reinterpret_cast<const uint8_t*>(s.data());
66 auto data_size = static_cast<int64_t>(s.size());
67
68 InitializeUTF8();
69 bool b = ValidateUTF8NoInline(data, data_size);
70 if (b != expected) {
71 std::cerr << "Unexpected validation result" << std::endl;
72 std::abort();
73 }
74
75 while (state.KeepRunning()) {
76 bool b = ValidateUTF8NoInline(data, data_size);
77 benchmark::DoNotOptimize(b);
78 }
79 state.SetBytesProcessed(state.iterations() * s.size());
80}
81
82static void BenchmarkASCIIValidation(
83 benchmark::State& state, // NOLINT non-const reference

Callers 5

ValidateTinyNonAsciiFunction · 0.85
ValidateSmallAlmostAsciiFunction · 0.85
ValidateSmallNonAsciiFunction · 0.85
ValidateLargeAlmostAsciiFunction · 0.85
ValidateLargeNonAsciiFunction · 0.85

Calls 4

InitializeUTF8Function · 0.85
ValidateUTF8NoInlineFunction · 0.85
dataMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected