custom property searching speed question
Lynch, Jonathan
BNZ2 at CDC.GOV
Wed Mar 2 13:31:34 EST 2005
Say you had a custom property set - "theProps"
And the keys of this set were 1 through 500,000
So, basically, you had an array with half a million elements stored as a
custom property set. Then, you wanted to search that array, and do it in
such a way that the search returned the name and content of the first
custom property that contains the item for which you search.
Would the following method be fastest?
Set the custompropertyset to "theProps"
Put 0 into Z
Repeat for each element E in the customproperties of <myobject>
Add 1 to Z
If E contains <searchterm> then exit repeat
End repeat
Put Z && the customproperties[Z] of <myobject> into field "feedback"
My questions are this:
1) Is there a better or faster-access way to store the array than as a
custom property set?
2) Is there a search method that is faster than doing all those
comparisons in transcript? For example, lineoffset and itemoffset are
supposed to be very fast. Is it possible to use itemoffset on an array,
or is there anything that works like an elementoffset command would
work, if it existed?
3) Would it be faster to combine the array, and use itemoffset?
4) Could filter be made to work in this situation, or would it only give
the value of the element, but not the name of the element?
5) Anything faster that I am not thinking of?
Thanks,
Jonathan
--
More information about the use-livecode
mailing list