Next Making Programs Faster 101

1+1=0

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.


Next Copyright © 2003 M. J. Dominus