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 | jac...@hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
_______________________________________________
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode