3 ms·
And in this particular case: * You can choose to use handles smaller than a pointer. * The NFA is cyclic, which makes memory management quite the chore. Even
by burntsushi 3y ago
And in this particular case:
* You can choose to use handles smaller than a pointer.
* The NFA is cyclic, which makes memory management quite the chore. Even if you're using Rust's reference counted pointers. But if you use handles, the actual memory management becomes a lot simpler.
- muldvarp 3y ago> * You can choose to use handles smaller than a pointer. 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.
- burntsushi 3y agoIn 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.