Closed toddr closed 4 years ago
Why do those ops need to be internal, if 'index' is already a 'public' OP? This is either a further regex engine optimization, or a new optree rewrite 'rule' on the peephole optimizer level (but it's a mess).
On Sun, 20 Oct 2019, 15:30 Todd Rinaldo, notifications@github.com wrote:
There are times where C level string manipulation is faster than doing a regex.
It would sometimes be faster to be able to run things like
strcmp(...) strncasecmp(...)
The perl version strcmp is called "cmp" and is likely to be only faster than cmp if it doesn't handle all the edge cases properly, eg utf8 strings.
also tr/// is sometimes used as a faster regex
tr really shouldn't be faster than the regex engine, and/or perl should silently optimise one into the other where it makes sense
For those that want them it's trivial to write an XS module that exposes them to perl code. I don't think they are appropriate for perl internals as is however.
Yves
There are times where C level string manipulation is faster than doing a regex.
It would sometimes be faster to be able to run things like
also tr/// is sometimes used as a faster regex.
@lightsey will provide more details