At 11:22 30.11.01 +0000, you wrote: >As an aside, I am being lazy (because Ruslan's lady is so fast) and doing a >search every time I need to know if a record exists (sub 1k records, all >string based id). I wonder if I shouldn't cache the results in a list and >getPos to check that it exists - anybody ever tested to see which is quicker
Hi Elias,
list functions in Lingo are pretty fast, so I'd store the results in a list and do a getPos / findPos lookup. BUT I think it also depends on the datatype of the items in the list and the type of list you're using.
If you're storing names, say up to 10 characters long, I'd retrieve the list once from the db, have Lingo sort it for better performance and search the list thereafter. Same goes for integers, of course. If you're searching for long strings, you might consider that the list has to be kept in RAM and a Lingo search might not be as fast as a Valentina lookup, using an index. You also have to consider that strings are not case-sensitive in Lingo.....which can be an advantage, if that's what you're looking for :-)
If you're planning on doing lots of lookups in the list, I'd also recommend converting all the strings in the list into symbols after you retrieve them from the db. That way the getPos/findPos lookup will be way faster...
Martin. ©2001 Martin Kloss |