Page 1 of 1

Speed test for literals and variables

Posted: Wed Jan 28, 2015 9:59 pm
by dunbarx
This seems counterintuitive to me.

Code: Select all

on mouseUp
   put the ticks into tStart
   put "x" into tTest
   repeat 15000000
      put tTest into cc
      --put "abc" into cc  --this is faster
   end repeat
   answer the ticks - tStart
end mouseUp
Not that it matters much, and the difference is only about 3% (about 59 ticks vs 61, fairly repeatable), but the variable version lags the literal version. iMac, OS 10.9.5, LC 6.7.

Esoterica, but why?

Craig Newman