Next | Making Programs Faster | 101 |
One day in 1998 Jon Orwant posted to perl5-porters
He had benchmarked the $#line = 1000000 optimization
It was not speeding anything up
I tried to quantify the speedup of preallocating arrays, and found that it actually slows your code down. Always. Several benchmarks on several platforms with several versions of Perl 5 all chanted in unison: Avoid setting $#array.
(http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/1998-04/msg01096.html)
There was a big hue and cry over this
"$#line = 1000000 must be broken!"
Next | Copyright © 2003 M. J. Dominus |