Benchmarks to compare sorted maps and sets implemented in the Ordered Zig library with similar implementations in Rust, C, C++, and Java.
You can see the latest benchmark results here.
| Language | Sorted Maps | Sorted Sets |
|---|---|---|
| Zig | Ordered BTreeMap, CartesianTreeMap, and SkipListMap; std.Treap |
Ordered SortedSet and RedBlackTreeSet; std.Treap |
| Rust | std::collections::BTreeMap and indexset::BTreeMap |
std::collections::BTreeSet and indexset::BTreeSet |
| C | Klib kbtree with key-value entries, Klib kavl AVL tree, and tidwall/btree.c |
Klib kbtree with keys, Klib kavl AVL tree, and tidwall/btree.c |
| C++ | std::map, Abseil btree_map, and Boost flat_map |
std::set, Abseil btree_set, and Boost flat_set |
| Java | TreeMap<Long, Long>, fastutil Long2LongAVLTreeMap, and fastutil Long2LongRBTreeMap |
TreeSet<Long>, fastutil LongAVLTreeSet, and fastutil LongRBTreeSet |
For the steps below to work, you need to have Git and Nix (with flakes enabled) installed on your machine.
git clone https://github.com/CogitatorTech/benchmarks-ordered.git
cd benchmarks-orderednix developmake build
make bench # This may take a whileThe (raw) results of the benchmarks are stored in the results/ directory.
make reportCheck out docs/benchmarks.md for more details on the benchmarking methodology.
See CONTRIBUTING.md for details on how to make a contribution.
This project is licensed under the MIT License (see LICENSE).