This thread might also be of help
http://forums.wowace.com/showthread.php?t=19541
Originally Posted by Animor
Why is it faster to avoid ipairs and simply iterate through the array, as you wrote?
|
The first method (iterating through the array), because it is a table lookup only. The second method (ipairs) calls a function which basically does the same table lookup and returns the result.
|
Originally Posted by Phanx
If you are using an array, it is slightly faster to avoid ipairs and simply iterate through the table this way:
... but it's not really significant, so if you feel that ipairs is easier for you as a programmer to read and understand, feel free to use it.
|
I totally agree with this
and maybe someone is going to pop up with some benchmarks