Arrays in Rev (long)
Troy Rollins
troy at rpsystems.net
Tue Jul 13 00:24:42 EDT 2004
On Jul 13, 2004, at 12:08 AM, Troy Rollins wrote:
> But then, here is something interesting, based on an adaptation of
> your benchmark script (note that the array even uses a slower repeat
> structure.) -
Even more interesting, addressing the keys of the array by string name
rather than integer key location, doesn't increase the time appreciably
(then again, I imagine even the element location is a string in
Transcript.) -
Props: 281
Vars: 13
Array: 153 Keys: 10000
-------------------------------
on mouseUp
put 10000 into N
--
put the millisecs into s
repeat n
set the uTest of this stack to "hello world"
get the uTest of this stack
end repeat
put the millisecs - s into s1
--
put the millisecs into s
repeat n
put "Hello World" into tMyVar
get tMyVar
end repeat
put the millisecs - s into s2
--
put the milliSecs into s
repeat with i = 1 to n
put "Hello world" into tMyVar["Hello" & i]
get tMyVar["Hello"& i]
end repeat
put the milliSecs - s into s3
put the number lines in the keys of tMyVar into tKeyNum
put "Props: "&s1 &cr& "Vars: "& s2 &CR& "Array: " & s3 && "Keys: " &
tKeyNum
end mouseUp
--
Troy
RPSystems, Ltd.
http://www.rpsystems.net
More information about the use-livecode
mailing list