in reply to Convert string to array - performance challenge
Update: Don't consider or use this. It is broken per the replies below!
If you really feel the need for speed (at the expense of a little clarity), add this to your becnhmark:
$begin = time(); for( 0 .. 20 ) { my @a = reverse map chop( $buffer), 0 .. length( $buffer ) -1; } printf( "reverse map chop consumed %.3f seconds\n", time() - $begin ); __END__ C:\test>junk47 split consumed 2.368 second(s) pack consumed 0.347 seconds pack and chr in map consumed 4.041 seconds unpack '{a1)* consumed 2.507 seconds substr for consumed 1.652 seconds reverse map chop consumed 0.477 seconds
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Convert string to array - performance challenge
by almut (Canon) on Apr 07, 2010 at 18:26 UTC | |
by BrowserUk (Patriarch) on Apr 07, 2010 at 18:41 UTC | |
|
Re^2: Convert string to array - performance challenge
by ikegami (Patriarch) on Apr 07, 2010 at 18:31 UTC | |
by samarzone (Pilgrim) on Apr 08, 2010 at 06:19 UTC | |
by almut (Canon) on Apr 08, 2010 at 06:55 UTC | |
by ikegami (Patriarch) on Apr 08, 2010 at 15:11 UTC | |
by BrowserUk (Patriarch) on Apr 07, 2010 at 18:42 UTC |