[ANN] News Reader Stack Available
Dar Scott
dsc at swcp.com
Wed Jun 18 21:23:00 EDT 2003
On Wednesday, June 18, 2003, at 11:08 PM, Chipp Walters wrote:
> I'm with Jacqueline. I always thought it took the interpreter longer to
> figure out what it's looking at.
...
>>> Has anyone else any
>>> thoughts on the wisdom or otherwise of quoting all names?
>>
>> I believe there is a slight speed hit if you don't use quotes, since
>> the
>> engine has to figure out whether the word is a variable or a name.
A quick test on OS X seems to indicate that is not the case:
on mouseUp
local x
set the numberFormat to "0.000000"
put empty into field "Report"
put the long seconds into tEnd -- throw this one away
put the long seconds into tStart
put the long seconds into tEnd
put tEnd-tStart into tCorrection
put the long seconds into tStart
put the highlight of button "dummy" into x
put the long seconds into tEnd
put (tEnd - tStart - tCorrection) & " s quoted" & LF after field
"Report"
put the long seconds into tStart
put the highlight of button dummy into x
put the long seconds into tEnd
put (tEnd - tStart - tCorrection) & " s unquoted" & LF after field
"Report"
end mouseUp
Typical results:
0.000025 s quoted
0.000026 s unquoted
I would guess that the script compiler checks to see whether the name
was used as a variable so for in the script. If it has, it would
compile a variable use. If not, it would compile the same as a string.
If there is a real difference is is one or two microseconds on my
computer.
Dar Scott
More information about the use-livecode
mailing list