@codesections again, some improvements to your (new version of) code: https://play.rust-lang.org/?version=stable&mode=release&edition=2018&gist=e4e9953cc7919d0d9a44e809ffa264e2 (notes inline)
On my machine it is about 10% faster than your version, must be because it doesn't do the conversions between usize/i32/Option<i32> everywhere.
And again the Rust and JS versions are doing a similar number of allocations, that is why the performance is similar.
Thanks! I took your changes and ran with them—new code here: https://gist.github.com/codesections/9959d4ddaf23be19078802754482874d.
This Mastodon instance is for people interested in technology. Discussions aren't limited to technology, because tech folks shouldn't be limited to technology either!
We adhere to an adapted version of the TootCat Code of Conduct and follow the Toot Café list of blocked instances. Ash is the admin and is supported by Fuzzface, Brian!, and Daniel Glus as moderators.
Hosting costs are largely covered by our generous supporters on Patreon – thanks for all the help!