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

bump dependencies #103

Closed jqnatividad closed 2 years ago

jqnatividad commented 2 years ago

Instead of getting rid of hashbrown dependency (#98), upgrade to the latest release instead.

Also upgraded enum-map, serde_json and proptest to their latest release.

greyblake commented 2 years ago

@jqnatividad Thanks. Could pls share the benchmarks before and after the changes? (run cargo bench). Last time I've tried it there was some downgrade in performance.

jqnatividad commented 2 years ago

Here you go @greyblake... I did three runs for each.

FWIW, my devt environment is Ubuntu 20.04 LTS running on a VirtualBox 6.1 VM assigned 8 processors with 12 GB, running on a Windows 11 laptop with a 2.9 GHz Ryzen 7 4800H with 32 gb.

Current version:

running 2 tests
test bench_detect        ... bench:   8,317,605 ns/iter (+/- 618,415)
test bench_detect_script ... bench:     236,234 ns/iter (+/- 13,920)

running 2 tests
test bench_detect        ... bench:   8,285,636 ns/iter (+/- 1,043,349)
test bench_detect_script ... bench:     235,663 ns/iter (+/- 13,113)

running 2 tests
test bench_detect        ... bench:   8,306,003 ns/iter (+/- 969,624)
test bench_detect_script ... bench:     235,109 ns/iter (+/- 35,717)

With upgraded dependencies:

running 2 tests
test bench_detect        ... bench:   9,651,909 ns/iter (+/- 1,831,484)
test bench_detect_script ... bench:     245,281 ns/iter (+/- 68,907)

running 2 tests
test bench_detect        ... bench:   9,385,073 ns/iter (+/- 1,347,755)
test bench_detect_script ... bench:     238,349 ns/iter (+/- 13,819)

running 2 tests
test bench_detect        ... bench:   9,379,881 ns/iter (+/- 706,980)
test bench_detect_script ... bench:     237,497 ns/iter (+/- 40,010)
greyblake commented 2 years ago

@jqnatividad Thanks. I guess now you see the reason why I am not rushing with the update...

jqnatividad commented 2 years ago

Yep! Now I do... you would think performance would get better with newer releases.

Anyway, perhaps I can focus my efforts on #104 instead? :grin: