On 9/24/2014, 2:20 AM, la...@significantplanet.org wrote:
I am using a for each loop and have run some benchmark time tests. I am
able to find (match) the words I want in about 1/7 of the time that it
used to take me using a different procedure - and the old way was pretty
fast!  To find all the smaller words (length of 2 - 7) contained in a
12-ltr word, it used to take 3.46 seconds. Now it only takes 0.56 seconds.

Yesterday I tinkered with this:


function getMatch pString,pSource
  put len(pSource) into tSourceLength
  repeat for each char c in pString
    delete char offset(c,pSource) of pSource
  end repeat
  return len(pSource) = tSourceLength - len(pString)
end getMatch

It may or may not be faster than your current method. On my Mac it can do 10,000 lookups in about 350 milliseconds.

--
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

Reply via email to