in reply to Re^4: Best way to sum an array?
in thread Best way to sum an array?
Darned if I can find any significant difference for as few as 3 numbers to add. Pretty consistently 4-5/100ths for both to start perl, count the numbers and return to the prompt
Interesting. Using precisely your 2 scripts, I see the withListUtil.pl taking about 60-70% longer.
$ time for i in {1..1000}; do perl withListUtil.pl > /dev/null; done real 0m6.512s user 0m3.820s sys 0m2.867s $ time for i in {1..1000}; do perl withoutListUtil.pl > /dev/null; don +e real 0m3.880s user 0m1.538s sys 0m2.497s
For the record, this is perl v5.20.3 with List::Util v1.42 on 64-bit Linux.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^6: Best way to sum an array?
by BrowserUk (Patriarch) on May 26, 2017 at 07:03 UTC |