Closed
Description
Description
I have discovered PCRE preg_match
is at least twice as slow when using named groups.
PCRE internally remaps named groups to indexes, so the slowdown is comming from php-src.
I belive the reason is the named group names zvals are created each time the preg_match
is run.
I propose to improve the performance by caching the names zvals in the regex cache entry - https://github.com/php/php-src/blob/php-8.3.7/ext/pcre/php_pcre.c#L55