Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reduce allocations and retentions in Journey TransitionTable
`DEFAULT_EXP` is by far the most common regexp being anchored. By special casing it, we can re-use the existing `DEFAULT_EXP_ANCHORED` regexp, and avoid keeping lots of copies of it in memory. Every time we hit, we also avoid having to compile the regexp, so it's faster. We also replace the `Regexp.new(/\A#{sym}\Z/)` pattern by just `/\A#{sym}\Z/`, as it was compiling and instantiating an extra regexp for no good reason.
- Loading branch information