Keys of a custom property array
J. Landman Gay
jacque at hyperactivesw.com
Sun Mar 3 16:20:13 EST 2013
On 3/3/13 1:44 PM, Mark Wieder wrote:
> Jacque-
>
> Sunday, March 3, 2013, 11:20:38 AM, you wrote:
>
>> Assuming speed isn't an issue either way, any idea which would be more
>> memory-efficient?
>
> No idea. We'd have to know how and when the engine handles garbage
> collection. If you see significant speed differences in the different
> methods, then my guess would be the engine making a working copy of
> the array. But whether it marks the copy as not in use after that or
> whether it remains in a cache is a mystery, at least until the FOSS
> release of the engine code.
>
So I loaded in a 900-key array, total size on disk of about 200K. Did this:
on test1
put the milliseconds into tStart
repeat 10000
put the keys of (the cArray of me) into tKeys
end repeat
put "test1:" && the milliseconds - tStart
end test1
on test2
put the milliseconds into tStart
repeat 10000
get the cArray of me
put the keys of it into tKeys
end repeat
put "test2:" && the milliseconds - tStart
end test2
Test 1 = 450
Test 2 = 4946
I'm not sure what it means, but getting only the keys is way faster.
--
Jacqueline Landman Gay | jacque at hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
More information about the use-livecode
mailing list