Not always:
$s = 'x'x3000 . 'reg exp' . 'x'x3000; cmpthese -1, { REGEX => q[ $x = $s =~ /reg exp/;], INDEX => q[ $x = index $s, 'reg exp';] };; Rate INDEX REGEX INDEX 40470/s -- -74% REGEX 156392/s 286% --
In reply to Re^2: Performance optimization question
by BrowserUk
in thread Performance optimization question
by vit
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |