kyren / hashlink

An updated version of linked-hash-map and friends
Apache License 2.0
98 stars 18 forks source link

Should hashlink no longer depend on hashbrown? #13

Open Zizico2 opened 3 years ago

Zizico2 commented 3 years ago

The SwissTable implementation in hashbrown as been merged to std. https://github.com/rust-lang/rust/pull/58623 Should the dependency be kept or should this use the std version?

rusty-snake commented 3 years ago

The default hasher of std and the hashbrown crate are still different:

The default hashing algorithm is currently SipHash 1-3

The default hashing algorithm is currently AHash

So hashbrown::HashMap is still faster than std::collections::HashMap. However type HashMap<K, V> = std::collections::HashMap<K, V, ahash::RandomState> should have the same performance as hashbrown::HashMap IIUC.

PsiACE commented 3 years ago

love this idea

Dushistov commented 2 years ago

Two versions of hashbrown seems overkill.

kyren commented 2 years ago

Unfortunately, the raw table API is not stabilized in std, which is the only real reason that this crate depends directly on hashbrown. Ideally, hashbrown would be completely unnecessary.

Once the raw table API is stabilized, this crate can easily shift over to use the HashMap types directly from std.