In this repository, different PQ implementations are benchmarked on various workloads. The PQ implementations include:
std::priority_queueboost::heap::d_ary_heapwith different aritiesboost::heap::fibonacci_heapboost::heap::pairing_heapmultiqueue::merge_heapThe binary merge heap from the MultiQueuequick_heapA custom quick heap implementationquick_heap_avx2A AVX2 version of the quick heap.
The workloads include:
HeapSort: push n elements, then pop n elements.GrowShrink: push-push-pop for n iterations, then pop-push-pop for n iterations.PushPop: Pre-fill the PQ with n elements, then perform n push-pop iterations.
Random values for the workloads are drawn uniformly at random from the range [0, n) and [0, 1000) for the Small variant.
Each workload besides the HeapSort comes in two variants:
Random: the pushed values are drawn uniformly at random.Monotonic: the pushed values aret+rwheretis the last popped value andris drawn uniformly at random.
- CMake 3.18 or higher
- A C++20 compatible compiler (tested with GCC 15.2)
- Boost
- Google Benchmark (will be downloaded automatically if not found)
- (Optional) Catch2 v3 for running tests (will be downloaded automatically if not found)
cmake --preset release
cmake --build --preset releaseRunning the benchmark will take several minutes. Benchmarks can be filtered using the --benchmark_filter flag.
./build/release/pq_benchmark --benchmark_format=csv | tee results.csvPlotting requires R. The script produces a plot.pdf file.
Rscript scripts/plot_results.R