Keats / tera2

28 stars 3 forks source link

Switch to `hashbrown::HashSet/Map` #13

Closed jalil-salame closed 8 months ago

jalil-salame commented 9 months ago

Uses AHash instead of SipHash which is faster.

Tested FxHash, no noticeable improvements over AHash but it requires a lot more changes (HashMap::new and HashMap::with_capacity are nto available, you have to use the _with_hasher versions).

11% improvement to realistic.

Overall about 10% improvements

hashbrown advertises a smaller hashmap size which seems to improve serialization by ~30%.

jalil-salame commented 8 months ago

I resolved all review questions!

Keats commented 8 months ago

Looking at it again, we probably want to depend explicitly on ahash for the preserve_order feature.

Keats commented 8 months ago

https://www.reddit.com/r/rust/comments/17xgn0t/gxhash_a_new_extremely_fast_and_robust_hashing/ to look at

jalil-salame commented 8 months ago

https://www.reddit.com/r/rust/comments/17xgn0t/gxhash_a_new_extremely_fast_and_robust_hashing/ to look at

Looks like it's nightly only, but with plans to use stable. I'll take a look