]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/boost/libs/histogram/benchmark/axis_index.cpp
import quincy beta 17.1.0
[ceph.git] / ceph / src / boost / libs / histogram / benchmark / axis_index.cpp
index fb8e71f77055a7e793cd574740dca4546fa07a5e..f2dc324f6fa8bdacb872393ba801e71648ec9c08 100644 (file)
 #include "../test/throw_exception.hpp"
 #include "generator.hpp"
 
-#include <boost/assert.hpp>
+#include <cassert>
 struct assert_check {
   assert_check() {
-    BOOST_ASSERT(false); // don't run with asserts enabled
+    assert(false); // don't run with asserts enabled
   }
 } _;
 
@@ -57,6 +57,12 @@ static void category(benchmark::State& state) {
   for (auto _ : state) benchmark::DoNotOptimize(a.index(gen()));
 }
 
+static void boolean(benchmark::State& state) {
+  auto a = axis::boolean<>();
+  generator<uniform_int> gen(1);
+  for (auto _ : state) benchmark::DoNotOptimize(a.index(static_cast<bool>(gen())));
+}
+
 BENCHMARK_TEMPLATE(regular, uniform);
 BENCHMARK_TEMPLATE(regular, normal);
 BENCHMARK_TEMPLATE(circular, uniform);
@@ -68,3 +74,4 @@ BENCHMARK_TEMPLATE(integer, double, normal);
 BENCHMARK_TEMPLATE(variable, uniform)->RangeMultiplier(10)->Range(10, 10000);
 BENCHMARK_TEMPLATE(variable, normal)->RangeMultiplier(10)->Range(10, 10000);
 BENCHMARK(category)->RangeMultiplier(10)->Range(10, 10000);
+BENCHMARK(boolean);