Open algebraic-dev opened 4 months ago
For those who are interested in shaving off unnecessary allocations:
saveSlots
every time it's called, which can be reused across the callssaveSize
. We should allocate it once for one captureNext
call (ideally once for each size).Option Pos
incurs a heap allocation. Since the string length is bounded in practice, we can embed .none
into Pos
and just use usize
under the food.I'd recommend #11 first though so that we have a benchmark to measure the effect of the optimizations.
The rust regex library uses caching for improving a little bit the performance. I think that we could add something for it.