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

Function BinaryBitOp

cpp/src/arrow/util/decimal_benchmark.cc:276–292  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

274}
275
276static void BinaryBitOp(benchmark::State& state) { // NOLINT non-const reference
277 std::vector<BasicDecimal128> v1, v2;
278 for (int x = 0; x < kValueSize; x++) {
279 v1.emplace_back(100 + x, 100 + x);
280 v2.emplace_back(200 + x, 200 + x);
281 }
282
283 static_assert(kValueSize % 2 == 0,
284 "kValueSize needs to be a multiple of 2 to avoid out-of-bounds accesses");
285 for (auto _ : state) {
286 for (int x = 0; x < kValueSize; x += 2) {
287 benchmark::DoNotOptimize(v1[x] |= v2[x]);
288 benchmark::DoNotOptimize(v1[x + 1] &= v2[x + 1]);
289 }
290 }
291 state.SetItemsProcessed(state.iterations() * kValueSize);
292}
293
294BENCHMARK(FromString);
295BENCHMARK(ToString);

Callers

nothing calls this directly

Calls 1

emplace_backMethod · 0.80

Tested by

no test coverage detected