https://github.com/justintimperio/pq-bench
Benchmarks for various priority queue implementations in Go, Rust, Zig, and C++
https://github.com/justintimperio/pq-bench
Last synced: 9 months ago
JSON representation
Benchmarks for various priority queue implementations in Go, Rust, Zig, and C++
- Host: GitHub
- URL: https://github.com/justintimperio/pq-bench
- Owner: JustinTimperio
- License: mit
- Created: 2024-08-21T03:55:13.000Z (almost 2 years ago)
- Default Branch: master
- Last Pushed: 2024-12-22T05:55:53.000Z (over 1 year ago)
- Last Synced: 2025-09-13T04:52:16.699Z (10 months ago)
- Language: Zig
- Homepage:
- Size: 153 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# PQ-Bench
## Background
This repository contains benchmarks for various priority queue implementations in Go, Rust, Zig, and C++. All tests are single threaded and designed to try and reproduce roughly the same workload across all implementations. While these benchmarks are not perfect, they should give a rough idea of the performance of each implementation and how they might work in a real-world scenario.
### Sister Repositories
- [fibheap (Fibonacci Heaps)](https://github.com/JustinTimperio/fibheap)
- [gpq (Go Priority Queue)](https://github.com/JustinTimperio/gpq)
- [rpq (Rust Priority Queue)](https://github.com/JustinTimperio/rpq)
## Benchmarks

Language | Time Spent (seconds)
---------------------|---------------------
RPQ | 1.38
RPQ (Batch) | 0.98
RPQ (Batch Parallel) | 0.62
GPQ | 5.54
GPQ (Batch) | 4.83
GPQ (Batch Parallel) | 2.98
Zig (STD LIB) | 0.87
Rust (STD LIB) | 0.72
Go (STD LIB) | 3.61
C++ (STD LIB) | 4.24
Python (STD LIB) | 15.03
## Features
| Feature | GPQ | RPQ | Go Heap | Zig Priority Queue | C++ Queue | Rust Binary Heap |
|------------------|-----|-----|---------|--------------------|-----------|------------------|
| Enqueue | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| Dequeue | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| Disk Cache | ✅ | ✅ | ❌ | ❌ | ❌ | ❌ |
| Mutable Priority | ✅ | ✅ | ✅ | ❌ | ❌ | ❌ |
| Timeouts | ✅ | ✅ | ❌ | ❌ | ❌ | ❌ |