in reply to Re: array pre-allocation trick
in thread array pre-allocation trick
No, push is going to grow your array. Try something like:
Although if you really are really tight, you may want to test if a while or C-style loop is faster than building the list of integers.for ( 0..4999) { $array[$_] = $_; }
|
|---|