84void BM(benchmark::State& state,
bool Stuffed) {
85 int64_t numBytes = state.range(0);
87 assert(numBytes <= std::numeric_limits<int>::max());
93 genStuffed.
emplace(numBytes,
false);
94 numBytes = genStuffed->numBytesGenerated;
95 input = genStuffed->getInput();
98 numBytes = genUnstuffed->numBytesGenerated;
99 input = genUnstuffed->getInput();
101 benchmark::DoNotOptimize(input->begin());
104 std::vector<OutputChunkType,
106 std::allocator<OutputChunkType>>>
111 for (
auto _ : state) {
116 std::back_inserter(output)));
118 decltype(bsInserter)>;
122 for (
auto bits : *input) {
123 benchmark::DoNotOptimize(bits);
124 benchmark::DoNotOptimize(count);
129 state.SetComplexityN(numBytes);
130 state.counters.insert({
132 benchmark::Counter(
sizeof(uint8_t) * state.complexity_length_n(),
133 benchmark::Counter::Flags::kIsIterationInvariantRate,
134 benchmark::Counter::kIs1024)},
136 benchmark::Counter(
sizeof(uint8_t) * state.complexity_length_n(),
137 benchmark::Counter::Flags::kIsIterationInvariantRate |
138 benchmark::Counter::Flags::kInvert,
139 benchmark::Counter::kIs1000)},
144 b->Unit(benchmark::kMicrosecond);
145 b->RangeMultiplier(2);
147 static constexpr int L1dByteSize = 32U * (1U << 10U);
148 static constexpr int L2dByteSize = 512U * (1U << 10U);
149 static constexpr int MaxBytesOptimal = L2dByteSize * (1U << 2);
156 if constexpr ((
true)) {
157 b->Arg(MaxBytesOptimal);
159 b->Range(8, MaxBytesOptimal * (1U << 2));
160 b->Complexity(benchmark::oN);