https://github.com/lucacappelletti94/comparing-hashsets
A small rust project comparing the perfomance of different set implementations
https://github.com/lucacappelletti94/comparing-hashsets
Last synced: 3 months ago
JSON representation
A small rust project comparing the perfomance of different set implementations
- Host: GitHub
- URL: https://github.com/lucacappelletti94/comparing-hashsets
- Owner: LucaCappelletti94
- License: mit
- Created: 2024-09-19T14:58:23.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2024-09-19T16:07:44.000Z (9 months ago)
- Last Synced: 2025-03-25T09:51:40.424Z (3 months ago)
- Language: Rust
- Size: 3.91 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Comparing HashSets
A small rust project comparing the perfomance of different set implementationsThe benchmark consists of inserting a large amount of u64 values sampled using a splitmix64 + xorshift64 random number generator, and measuring the time it takes to insert all the values.
## Running the benchmarks
The benchmark is a criterion benchmark, so you can run it using cargo. To run the benchmark, use the following command:```bash
RUSTFLAGS="-C target-cpu=native" cargo bench
```## Current results
The benchmark results, sorted by decreasing performance, are as follows:| Collection | Time (ms) |
|------------------------------|-------------------|
| `rustc_hash::FxHashSet` | 1.3063 - 1.3076 |
| `ahash::AHashSet` | 1.6001 - 1.6054 |
| `hashbrown::HashSet` | 1.9176 - 1.9227 |
| `std::collections::HashSet` | 4.3500 - 4.3569 |
| `std::collections::BTreeSet` | 8.1370 - 8.1452 |
| `Vec` | 1,109.2 - 1,109.5 |## Would you like to add another HashSet implementation
By all means, we would love to see more implementations. Open up an issue to discuss it, and then submit a PR with your implementation. We will be happy to review it.