Anders429 / word_filter

A Word Filter for filtering text.
Apache License 2.0
1 stars 0 forks source link

Use a non-DoS resistant Hasher #33

Open Anders429 opened 3 years ago

Anders429 commented 3 years ago

There is no reason not to use something faster than ahash. We don't need DoS resistance, since it isn't user-generated data that is being stored.

I've been looking at something like twox-hash. Looks like there is work towards implementing xxhash3, but it isn't quite finished yet. Regardless, the benchmarks seem very promising.

It might be good to do some benchmarking here to evaluate speed increases on both creation and query.

Anders429 commented 3 years ago

With the changes from #37, all of the Hashers in the core crate can be replaced by an IdentityHasher from the identity_hasher crate I've been working on.

It will positively be faster than the current Hasher, as it is as close to a no-op as you can get in a Hasher.

Still will be good to get some benchmarks up. Benchmarking is proving to be harder than I guessed :/

Anders429 commented 3 years ago

This still isn't quite ready (it's blocked by a few things) and the benefit isn't that large. It can be added in a patch release later when it is ready, but I'm going to release 0.6.0 without this.