Skip to content
/ heap Public

Looking into the performance of heaps, starting with the Min-Max Heap

Notifications You must be signed in to change notification settings

skarupke/heap

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

C++ Implementation of Min-Max heap and D-ary heap

See the blog post at https://probablydance.com/2020/08/31/on-modern-hardware-the-min-max-heap-beats-a-binary-heap/

The benchmarks require google benchmark to run. On Ubuntu you can "apt install libbenchmark-dev" Otherwise you can find it here: https://github.com/google/benchmark

The benchmark results are as follows:
To calculate the time to push an item take
time(benchmark_push_minmax_heap) - time(benchmark_heap_baseline)
To calculate the time to make the heap take
time(benchmark_make_minmax_heap) - time(benchmark_heap_baseline)
To calculate the time to pop an item take
time(benchmark_pop_minmax_heap_min) - time(benchmark_make_minmax_heap) or
time(benchmark_pop_minmax_heap_max) - time(benchmark_make_minmax_heap)

Meaning make sure to always subtract the baseline or the time to make the heap.

About

Looking into the performance of heaps, starting with the Min-Max Heap

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages