You are viewing the version of this documentation from Perl blead. This is the main development branch of Perl. (git commit 1e5751ae732b0c2b7c8ddac3f534f7d3d620da7b)
${^RE_SUPERLINEAR_CACHE_DELAY}

Added in Perl 5.46.0.

This integer-valued variable allows the initial countdown delay in the regex engine's super-linear cache mechanism to be adjusted for testing and debugging purposes. It is not intended for production code, and its semantics may change without notice.

When matching a complex pattern with much backtracking, after a certain number of iterations a cache is allocated to detect backtracks to the same position and state. The countdown is intended so that the cache isn't wastefully allocated for every match, but instead only for matches which seem to be backtracking too much. Normally the initial countdown is proportional to the length of the string being matched.

This variable's value has the following meanings:

0

Use the default delay countdown value.

1+

Use the specified number of countdown iterations (1 implies no delay).

-1

Disable the cache completely.

-N (other than -1)

Scale the normal delay count by N / 1E6 (so for example -500000 causes half as many countdown iterations as normal).