in reply to Re^2: Counting the number of items returned by split without using a named array
in thread Counting the number of items returned by split without using a named array
C:\test>p1 our $s = join ' ', 'aa'..'zz';; cmpthese -3, { split => q[ $_=$s; my $n = @{[ split ]}; ], regex => q[ $_=$s; my $n = () = /\S+/g; ] };; Rate regex split regex 546/s -- -50% split 1102/s 102% --
Assuming I didn't goof on the benchmark split appears to be quicker.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Counting the number of items returned by split without using a named array
by Anonymous Monk on May 03, 2006 at 15:16 UTC | |
by BrowserUk (Patriarch) on May 03, 2006 at 16:34 UTC | |
by Anonymous Monk on May 03, 2006 at 17:32 UTC | |
by Anonymous Monk on May 03, 2006 at 15:20 UTC |