- or download this
>perl -MO=Concise -e"\substr($_,1)" 2>&1 | find "substr"
5 <@> substr[t4] sKRM/2 ->6
...
^
|
Not modifiable => no magic created.
- or download this
Pass 1: Creates a 79,999 char string & copies it into $a's buffer
Pass 2: Creates a 79,998 char string & copies it into $a's buffer
...
...
Pass 79,999: Creates a 1 char string & copies it into $a's buffer
Pass 80,000: Creates a 0 char string & copies it into $a's buffer
- or download this
$a =~ s/.//s; # Remove leading char with no copying.
substr($a, 0, 1, ''); # Remove leading char with no copying.
- or download this
--------------------
20,000
...
substr3 0.445/s -- -98% -99% (warning: unreliable count)
s/// 23.4/s 5162% -- -42%
substr4 40.1/s 8897% 71% --
- or download this
use strict;
use warnings;
...
cmpthese($OUTER, \%bench);
print("\n");
}