diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2020-07-02 22:33:52 +0000 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2020-07-02 22:38:55 +0000 |
| commit | df2c27eb486383a291dfe1db3dfda51f830f59c5 (patch) | |
| tree | 9af0034e86f206850d3ec5d1fa66582543c490b5 /lib/std/buf_set.zig | |
| parent | 70cc1751ca69dd77625c703445713d067215b5d9 (diff) | |
| download | zig-df2c27eb486383a291dfe1db3dfda51f830f59c5.tar.gz zig-df2c27eb486383a291dfe1db3dfda51f830f59c5.zip | |
stage1 HashMap: store hash & do robin hood hashing
This adds these two fields to a HashMap Entry:
uint32_t hash
uint32_t distance_from_start_index
Compared to master branch, standard library tests compiled 8.4% faster
and took negligible (0.001%) more memory to complete. The amount of
memory used is still down from before 8b82c4010480 which moved indexes
to be stored separately from entries.
So, it turns out, keeping robin hood hashing plus separating indexes
did result in a performance improvement. What happened previously is
that the gains from separating indexes balanced out the losses from
removing robin hood hashing, resulting in a wash.
This also serves as an inspiration for adding a benchmark to
std.AutoHashMap and improving the implementation.
Diffstat (limited to 'lib/std/buf_set.zig')
0 files changed, 0 insertions, 0 deletions
