Fastest memory based search technique (was: Adding 1 to an array)

David Bovill david at openpartnership.net
Sun Jun 24 07:32:13 EDT 2007


Thanks Ken.

On 24/06/07, Ken Ray <kray at sonsothunder.com> wrote:

> on mouseUp
>   put 1 into tA[1]
>   put 2 into tA[2]
>   put 3 into tA[3]
>   put tA + 1 into tA
>   put tA[1],tA[2],tA[3]
> end mouseUp


On 24/06/07, Jim Ault <JimAultWins at yahoo.com> wrote:

> Does the list of tags change or is it static?
>

Its a general technique for keyword indexes I'm looking at, in this example
it is for Rev handlers, each of which can have many keywords. It's the "find
similar" algorithm I posted about earlier - so if a handler has say these 6
keywords - which other handlers have similar keywords. Or another way of
putting it if a user types in some keywords, how can we find related
handlers in the library?

These are the types of technique I'd like to compare:

   1. My very old stack searched for keywords in a field, and i am
   looking for a better way
   2. Use indexes and loop though them with repeat
   3. Use arrays and use union and intersect (current experiment)
   4. Use database

I'm interested to see how the old style card index compares for speed with
the rest.

 This is what i am thinking;

   1. Users will type in (or select from a list) the most important
   keywords first
   2. Keywords can be in any order
   3. Cannot index all keyword combinations - so need fast dynamic lookup
   4. indexes of keyword => handlerNames are useful so lets store them
   somehow

If from each keyword i can fetch an index of handler names from an array
then I have several indexes - then i guess i just need the fastest way to
calculate unions of indexes. I'm thinking that arrays and union will be
faster than repeating through and index or array.



More information about the use-livecode mailing list