in reply to Re^4: counting backward (optimize foreach reverse low .. high
in thread counting backward
I had to stop the second version because the swapping started to freeze my system:
lanx@nc10-ubuntu:~$ perl -e'for my $i ( 0 .. 1e8 ) { $x*=-1; $x+=$i }; +print "$x\n"' 50000000 lanx@nc10-ubuntu:~$ perl -e'for my $i ( reverse 0 .. 1e8 ) { $x*=-1; $ +x+=$i };print "$x\n"' ^C^C^C lanx@nc10-ubuntu:~$ perl -version This is perl, v5.10.0 built for i486-linux-gnu-thread-multi ...
Reversing ranges was what BUK did, but AnoMonk replied with a reference to a fix for reversing arrays!
Cheers Rolf
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^6: counting backward (optimize foreach reverse low .. high
by dave_the_m (Monsignor) on Mar 02, 2013 at 17:37 UTC | |
|
Re^6: counting backward (optimize foreach reverse low .. high
by Anonymous Monk on Mar 02, 2013 at 16:24 UTC |