An interesting programming challenge

Geoff Canyon gcanyon at gmail.com
Fri Apr 10 18:29:57 CEST 2015


On Fri, Apr 10, 2015 at 10:25 AM, Ben Rubinstein <benr_mc at cogapp.com> wrote:

> making use of arrays which I always believe are insanely fast


Arrays are much slower than simple variables.

-- takes > 9 seconds:
on mouseUp
   put the long seconds into T
   repeat with i = 1 to 10000000
      get i mod 100
      add 23 to X[i]
   end repeat
   put the long seconds - T
end mouseUp

-- takes < 1.8 seconds
on mouseUp
   put the long seconds into T
   repeat with i = 1 to 10000000
      get i mod 100
      add 23 to X
   end repeat
   put the long seconds - T
end mouseUp


More information about the use-livecode mailing list