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[$_] = $_; }
In reply to Re: Re: array pre-allocation trick
by rir
in thread array pre-allocation trick
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |