Post from wezm on 25 Apr 2021

This is a static archive of wezm@decentralised.social

https://mastodon.decentralised.social/@wezm is now my primary account

☜ Back to home page
wezm
↩ reply to @schlink I profiled the code and it was spending a lot of time in `is_on_list`. For large word lists it's iterating over a large portion of the list every time it needs to see if it's on the list. Switching to a HashSet instead of Vec yields a big speed up as testing inclusion in the list is now a constant time operation. Using a set also makes `make_clean_list` much easier too.

https://github.com/wezm/csafe/commit/16517121d120679eba965b813082f101440adaf2