Re:Translations of Russ Cox's Thompson NFA C Program to Rust
by burntsushi on Friday November 03, 2023 @08:53AM
(#38127963)
In this particular program I didn't do an in depth performance comparison because it wasn't really the point of the exercise.
But in the actual regex crate, I do indeed use `u32` as a representation for a handle. To a first approximation, it corresponds to about half as much memory usage.
Same deal with the aho-corasick crate.
Did you measure any performance improvements due to using small handles?
I have a medium-sized project that uses a ton of `usize`s to reference elements in `Vec`s and would love to know if there's some potential for performance improvements there.