See article at mhdm.dev/posts/sb_lower_bound/
Example ways to run the benchmark:
clang++ -std=c++20 -Wall -O2 -march=haswell -mllvm -x86-cmov-converter=false test.cpp -o test && ./test
clang++ -std=c++20 -Wall -O2 -march=haswell test.cpp -o test && ./test
g++ -std=c++20 -Wall -O2 -march=haswell test.cpp -o test && ./test
Show the number of comparisons the lower_bound()
variants do:
clang++ -DCOUNT_CALLS -std=c++20 -Wall -O2 test.cpp -o test && ./test