View Single Post
03-16-12, 05:53 AM   #7
Ketho
A Pyroguard Emberseer
 
Ketho's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 1,026
This thread might also be of help
http://forums.wowace.com/showthread.php?t=19541

Originally Posted by Animor View Post
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 View Post
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
  Reply With Quote