in reply to Re: Array How to/Performance: mass initialization or update using array slice
in thread Array How to/Performance: mass initialization or update using array slice
Off the top of my head I seem to recall that the slice operation is quicker than using a loop as most of the work is being done in C rather transitioning between C and perl as with a loop. However, you would probably need to be setting a few hundred elements of the array at a time, and/or doing this very often before you would notice the difference in runtime of your script.
That said, the slice method is very clean syntactically, so there is no reason not to use it, and any performance benefit never hurts, and is a nice bonus.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Array How to/Performance: mass initialization or update using array slice
by Anonymous Monk on Jun 21, 2003 at 10:34 UTC | |
|
Re: Re: Re: Array How to/Performance: mass initialization or update using array slice
by Anonymous Monk on Jun 21, 2003 at 09:02 UTC |