Which one is faster ?

Mark Wieder mwieder at ahsoftware.net
Wed May 18 12:57:39 EDT 2005


MisterX-

Wednesday, May 18, 2005, 9:27:22 AM, you wrote:

M> switch  -- note the lack of parameter, now the case handles if cases!
M>   case a=b
M>   break
M> end switch

Switch without a parameter !!??!! I reworked my benchmark test to try
this and found that this effectively slows the switch statement down
to the speed of the nested ifs (i.e., 20-35% slower), meaning that the
pcode is mapped to the same thing, where every test must be taken in
turn. Interesting technique, though.

-- 
-Mark Wieder
 mwieder at ahsoftware.net



More information about the use-livecode mailing list