Benchmark different implementations of Cassandra's timeuuid comparisons
dnf install google-benchmark-devel
dnf install cpupowerutils
cmake -B build .
cmake --build build
sudo cpupower frequency-set -g performance # Disable CPU frequency scaling
./build/benchmark
sudo cpupower frequency-set -g powersave # Re-enable CPU frequency scaling
There's a trivial implementation for base reference (cost of anti-optimizations).
clang++ vectorizes aggressively but performs slightly slower. g++ does not vectorize but seems to focus on data dependencies and produces faster code.
Benchmark Time CPU Iterations
-----------------------------------------------------
BM_trivial 2.49 ns 2.49 ns 270171299
BM_ori 4.31 ns 4.30 ns 159428276
BM_kostja 3.91 ns 3.90 ns 178458727
Benchmark Time CPU Iterations
-----------------------------------------------------
BM_trivial 2.30 ns 2.29 ns 300451685
BM_ori 4.16 ns 4.16 ns 166757347
BM_kostja 7.62 ns 7.61 ns 87890182