Six vs Half a Dozen

Dar Scott dsc at swcp.com
Wed Nov 20 16:06:01 EST 2002


On Wednesday, November 20, 2002, at 12:39 PM, Richard Gaskin wrote:

> According to RevBench, the difference is only about 0.0007 ticks in 
> favor of
> directly calling the handler over using "send".

I got 110 microseconds.

I threw "do" into the mix:
********************************************
local storeHere

on mouseUp
   local timeA, timeB, timeOffset

   put "abc" into toThis
   put the long seconds into timeA  -- in case something special about 
first long seconds

   -- create offset
   put the long seconds into timeB
   put the long seconds into timeA
   put timeA-timeB into timeOffset

   -- time simple call
   put the long seconds into timeB
   doThis toThis
   put the long seconds into timeA
   put timeA - timeB - timeOffset & lineFeed into Field "Destination"

   -- time do
   put the long seconds into timeB
   do "doThis toThis"
   put the long seconds into timeA
   put (timeA - timeB - timeOffset) & lineFeed after Field "Destination"

   -- time send to me
   put the long seconds into timeB
   send "doThis toThis" to me
   put the long seconds into timeA
   put (timeA - timeB - timeOffset) & lineFeed after Field "Destination"

end mouseUp

on doThis toSomething
   put toSomething into storeHere
end doThis
**************************************************

Typical results were like this (300MHz? Blue & White, OS X 1.1.5):

0.000032
0.000148
0.00012

(seconds for direct call, do and send)

It is interesting that a send is faster than a do.

Dar Scott




More information about the use-livecode mailing list