aboutsummaryrefslogtreecommitdiff
path: root/lib/std/buf_set.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2020-07-02 22:33:52 +0000
committerAndrew Kelley <andrew@ziglang.org>2020-07-02 22:38:55 +0000
commitdf2c27eb486383a291dfe1db3dfda51f830f59c5 (patch)
tree9af0034e86f206850d3ec5d1fa66582543c490b5 /lib/std/buf_set.zig
parent70cc1751ca69dd77625c703445713d067215b5d9 (diff)
downloadzig-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