Speed up a slow loop

Neville Smythe neville.smythe at optusnet.com.au
Fri Mar 4 15:33:13 EST 2022

Jacque, are you trying to keep the whole of SOWPODS in memory the whole time? That’s a 2.5MB file. It sounds to me like you are getting virtual memory thrashing.

If so, try breaking up the wordlist into 26 files for example - or even more by length as well as initial letter - kept as resources (rather than in fields)  and only reading in the file required to check  a word as needed (and emptying the variable loaded from file asap). My guess is a linear search on a small file is going to be faster than array indexing magic if memory swapping starts to occur.


More information about the use-livecode mailing list