An open API service indexing awesome lists of open source software.

https://github.com/squeek502/zig-hash-map-bench

Benchmarks for Zig's std.HashMap
https://github.com/squeek502/zig-hash-map-bench

benchmark hash-map zig

Last synced: 6 months ago
JSON representation

Benchmarks for Zig's std.HashMap

Awesome Lists containing this project

README

        

# zig-hash-map-bench

Benchmarks for [Zig](https://ziglang.org)'s `std.HashMap`. Will be expanded on in the future.

Based loosely on some of the benchmarking of C++ hash map implementations here:
- https://probablydance.com/2017/02/26/i-wrote-the-fastest-hashtable/
- https://tessil.github.io/2016/08/29/benchmark-hopscotch-map.html
- https://martin.ankerl.com/2019/04/01/hashmap-benchmarks-01-overview/
- https://github.com/ktprime/emhash#other-benchmark

## Running

Insertion without ensureCapacity:

```
zig run insert.zig -OReleaseFast -lc
```

```
zig run insert-strings.zig -OReleaseFast -lc
```

Output will be in the format:

```
num_elements,nanoseconds_per_element
1,68
2,40
3,32
5,25
7,21
10,19
...
```