Which is faster...
Bob Sneidar
bobsneidar at iotecdigital.com
Fri Dec 15 11:03:55 EST 2023
Good point. I always put data I intend to work on in a local variable anyway so it becomes easier to debug. As far as 1,000,000 iterations, I cannot imagine what anyone developing in Livecode who would want to do that inline with any other process. But then I failed 6th grade math, sooo….. there’s that.
Bob S
<snip>
On Dec 15, 2023, at 7:00 AM, Mark Waddingham via use-livecode <use-livecode at lists.runrev.com> wrote:
Overall, my suggestion would be probably to do a combination of both - if you are only reading from a custom property in a given loop, but are doing so multiple times for the same property (and the loop actually has a very high number of iterations!) then fetch into a local variable before the loop and then use that value (the same, to be fair, is true of calling functions which return fixed values and accessing array elements - especially ones on paths longer than one).
Hope this helps,
Mark.
--
Mark Waddingham ~ mark at livecode.com<mailto:mark at livecode.com> ~ http://www.livecode.com/
More information about the use-livecode
mailing list