Notwithstanding the timekeeping effects already raised, I can speed up the useless perl script by about a factor of 2 by avoiding the C-ish loop syntax.
$ time perl -e 'for($i=0;$i<=1e7;$i++){}' real 0m0.648s user 0m0.640s sys 0m0.005s $ time perl -e 'for(0..1e7){}' real 0m0.354s user 0m0.348s sys 0m0.002s
I don't have php installed so cannot compare. YMMV
In reply to Re: perl process slower and slower when loop number increase
by hippo
in thread perl process slower and slower when loop number increase
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |