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

Function BinaryCompareOpConstant

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

Source from the content-addressed store, hash-verified

103}
104
105static void BinaryCompareOpConstant(
106 benchmark::State& state) { // NOLINT non-const reference
107 std::vector<BasicDecimal128> v1;
108 for (int x = 0; x < kValueSize; x++) {
109 v1.emplace_back(100 + x, 100 + x);
110 }
111 static_assert(kValueSize % 4 == 0,
112 "kValueSize needs to be a multiple of 4 to avoid out-of-bounds accesses");
113 BasicDecimal128 constant(313, 212);
114 for (auto _ : state) {
115 for (int x = 0; x < kValueSize; x += 4) {
116 auto equal = v1[x] == constant;
117 benchmark::DoNotOptimize(equal);
118 auto less_than_or_equal = v1[x + 1] <= constant;
119 benchmark::DoNotOptimize(less_than_or_equal);
120 auto greater_than_or_equal = v1[x + 2] >= constant;
121 benchmark::DoNotOptimize(greater_than_or_equal);
122 auto not_equal = v1[x + 3] != constant;
123 benchmark::DoNotOptimize(not_equal);
124 }
125 }
126 state.SetItemsProcessed(state.iterations() * kValueSize);
127}
128
129static void BinaryMathOpAggregate(
130 benchmark::State& state) { // NOLINT non-const reference

Callers

nothing calls this directly

Calls 1

emplace_backMethod · 0.80

Tested by

no test coverage detected