in reply to Re^4: $str to %hash to @ary
in thread $str to %hash to @ary
I did notice that not on every pass all methods were "passing". If someone wanted to make it even faster they would randomize the array as part of set up time and then just loop through the array."L~R" => sub { my @foo; my $str = "17:43:33:21:23:19:27:6"; while (my $p = $str =~ /([^:]+)/g && $1 and my $add_id = $str +=~ /([^:]+)/g && $1) { push @foo, ($add_id) x $p; } \@foo; }, "L~R" => sub { my $addid = $_[0]->[ rand 100 ]; }, As mod_perl: (NOT from scratch each time): Rate fizbin ccn_fast ccn ccn_faster origCode du +ff L~R fizbin 35680/s -- -52% -53% -60% -91% -9 +1% -92% ccn_fast 74642/s 109% -- -2% -16% -80% -8 +1% -83% ccn 76321/s 114% 2% -- -14% -80% -8 +1% -82% ccn_faster 88368/s 148% 18% 16% -- -76% -7 +8% -80% origCode 375784/s 953% 403% 392% 325% -- - +6% -13% duff 398928/s 1018% 434% 423% 351% 6% +-- -8% L~R 432419/s 1112% 479% 467% 389% 15% +8% --
Cheers - L~R
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^6: $str to %hash to @ary
by fizbin (Chaplain) on Jul 25, 2004 at 14:51 UTC | |
by ccn (Vicar) on Jul 25, 2004 at 16:38 UTC | |
by fizbin (Chaplain) on Jul 25, 2004 at 18:56 UTC |