| 50 | } |
| 51 | |
| 52 | static void BitBlockCounterBench(benchmark::State& state) { |
| 53 | int64_t nbytes = state.range(0); |
| 54 | std::shared_ptr<Buffer> cond_buf = CreateRandomBuffer(nbytes); |
| 55 | for (auto _ : state) { |
| 56 | BitBlockCounter counter(cond_buf->data(), 0, nbytes * 8); |
| 57 | |
| 58 | int64_t offset = 0; |
| 59 | uint64_t set_bits = 0; |
| 60 | |
| 61 | while (offset < nbytes * 8) { |
| 62 | const BitBlockCount& word = counter.NextWord(); |
| 63 | // if (word.AllSet()) { |
| 64 | // set_bits += word.length; |
| 65 | // } else if (word.popcount) { |
| 66 | // set_bits += word.popcount; |
| 67 | // } |
| 68 | set_bits += word.popcount; |
| 69 | benchmark::DoNotOptimize(set_bits); |
| 70 | offset += word.length; |
| 71 | } |
| 72 | benchmark::ClobberMemory(); |
| 73 | } |
| 74 | |
| 75 | state.SetBytesProcessed(state.iterations() * nbytes); |
| 76 | } |
| 77 | |
| 78 | static void BitmapWordReaderBench(benchmark::State& state) { |
| 79 | int64_t nbytes = state.range(0); |
nothing calls this directly
no test coverage detected