greyblake / whatlang-rs

Natural language detection library for Rust. Try demo online: https://whatlang.org/
https://whatlang.org/
MIT License
970 stars 109 forks source link

Try to get rid of hashbrown #98

Closed greyblake closed 2 years ago

greyblake commented 3 years ago

Try to use std::collections::HashMap. Do benchmark, to ensure there is no regression in performance

jqnatividad commented 2 years ago

Pinging this issue @greyblake , as since Rust 1.36, hashbrown is now the HashMap implementation of the Rust standard library.

And the hashbrown folks benchmarked it too - https://github.com/rust-lang/hashbrown#performance

greyblake commented 2 years ago

@jqnatividad Thanks, I know. I've tried to switch to std HashMap, but it hits performance, I am not sure exactly why. You can also give it a try if you want to.

jqnatividad commented 2 years ago

Hi @greyblake , I went ahead as you suggested, but decided to bump hashbrown, and several other dependencies to their latest release.

greyblake commented 2 years ago

It does not look like hashbrown will go anywhere, benchmarks show that with std::collections::HashMap the detect() function is 2x slower. See https://github.com/greyblake/whatlang-rs/pull/119