diff --git a/configure.ac b/configure.ac index 49be89c..2b958f8 100644 --- a/configure.ac +++ b/configure.ac @@ -53,6 +53,14 @@ if test x$cxxmph = xtrue; then fi AM_CONDITIONAL([USE_CXXMPH], [test "$cxxmph" = true]) +AC_ENABLE_BENCHMARKS +if test x$benchmarks = xtrue; then + AC_LANG_PUSH([C++]) + AC_CHECK_HEADERS([hopscotch_map.h]) + AC_LANG_POP([C++]) +fi +AM_CONDITIONAL([USE_BENCHMARKS], [test "$benchmarks" = true]) + # Unit tests based on the check library. Disabled by default. # We do not use pkg-config because it is inconvenient for all developers to # have check library installed. diff --git a/cxxmph/Makefile.am b/cxxmph/Makefile.am index b542000..4ebaccb 100644 --- a/cxxmph/Makefile.am +++ b/cxxmph/Makefile.am @@ -5,7 +5,9 @@ if USE_LIBCHECK check_LTLIBRARIES = libcxxmph_test.la endif -noinst_PROGRAMS = bm_map # bm_index - disabled because of cmph dependency +if USE_BENCHMARKS + noinst_PROGRAMS = bm_map # bm_index - disabled because of cmph dependency +endif bin_PROGRAMS = cxxmph cxxmph_includedir = $(includedir)/cxxmph/ diff --git a/cxxmph/bm_map.cc b/cxxmph/bm_map.cc index a907e47..09a3bc5 100644 --- a/cxxmph/bm_map.cc +++ b/cxxmph/bm_map.cc @@ -1,7 +1,7 @@ #include #include + #include "hopscotch_map.h" -#include "flat_hash_map.hpp" #include "bm_common.h" #include "mph_map.h" @@ -104,27 +104,23 @@ int main(int argc, char** argv) { Benchmark::Register(new BM_CreateUrls>("URLS100k")); Benchmark::Register(new BM_CreateUrls>("URLS100k")); Benchmark::Register(new BM_CreateUrls>("URLS100k")); - Benchmark::Register(new BM_CreateUrls>("URLS100k")); Benchmark::Register(new BM_SearchUrls>("URLS100k", 10*1000 * 1000, 0)); Benchmark::Register(new BM_SearchUrls>("URLS100k", 10*1000 * 1000, 0)); Benchmark::Register(new BM_SearchUrls>("URLS100k", 10*1000 * 1000, 0)); Benchmark::Register(new BM_SearchUrls>("URLS100k", 10*1000 * 1000, 0)); Benchmark::Register(new BM_SearchUrls>("URLS100k", 10*1000 * 1000, 0)); - Benchmark::Register(new BM_SearchUrls>("URLS100k", 10*1000 * 1000, 0)); Benchmark::Register(new BM_SearchUrls>("URLS100k", 10*1000 * 1000, 0.9)); Benchmark::Register(new BM_SearchUrls>("URLS100k", 10*1000 * 1000, 0.9)); Benchmark::Register(new BM_SearchUrls>("URLS100k", 10*1000 * 1000, 0.9)); Benchmark::Register(new BM_SearchUrls>("URLS100k", 10*1000 * 1000, 0.9)); Benchmark::Register(new BM_SearchUrls>("URLS100k", 10*1000 * 1000, 0.9)); - Benchmark::Register(new BM_SearchUrls>("URLS100k", 10*1000 * 1000, 0.9)); Benchmark::Register(new BM_SearchUint64>); Benchmark::Register(new BM_SearchUint64>); Benchmark::Register(new BM_SearchUint64>); Benchmark::Register(new BM_SearchUint64>); Benchmark::Register(new BM_SearchUint64>); - Benchmark::Register(new BM_SearchUint64>); Benchmark::RunAll(); } diff --git a/m4/acinclude.m4 b/m4/acinclude.m4 index 07e81d1..370d63b 100644 --- a/m4/acinclude.m4 +++ b/m4/acinclude.m4 @@ -5,3 +5,11 @@ AC_DEFUN([AC_ENABLE_CXXMPH], [AC_ARG_ENABLE([cxxmph], no) cxxmph=false ;; *) AC_MSG_ERROR([bad value ${enableval} for --enable-cxxmph]) ;; esac],[cxxmph=false])]) + +AC_DEFUN([AC_ENABLE_BENCHMARKS], [AC_ARG_ENABLE([benchmarks], + [ --enable-benchmarks enable cxxmph benchmarks against other libs ], + [case "${enableval}" in + yes) benchmarks=true ;; + no) benchmarks=false ;; + *) AC_MSG_ERROR([bad value ${enableval} for --enable-benchmarks]) ;; + esac],[benchmarks=false])])