|
|
| There's more than one way to do things | |
| PerlMonks |
Re^2: Null-stripping performanceby Thelonius (Curate) |
| on Feb 26, 2007 at 14:37 UTC ( #602130=note: print w/ replies, xml ) | Need Help?? |
|
On my PC, The "substr(), y" method takes about 0.6 microseconds, the "substr(), s" method takes about 1 microsecond, the "unpack x$index" method takes about 2 microseconds. The "unpack a$index" method takes about 41 microseconds (when averaged over a 262000 byte string), so it's the one to avoid. It has to allocate the large substring it skips over before it throws it away.
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||