Originally Posted by Crepusculu
and using the local reference to bypass the lookup time on the global function? That sounds like it might help a bit.
|
It won't. The difference in execution time of local vs global functions is trivial. The difference between them for me, over a million iterations, is .077 second. If a user is running at 60 FPS with a completely unthrottled OnUpdate running constantly, you're saving .077 second of execution time every 4.6 hours.
There's no serious flaw in localizing globals that you're going to use
a lot, but there's really no tangible benefit unless you're trying to prevent the function from being tampered with outside of your addon.