how to compare 2 very large textfiles

Bob Sneidar bobs at twft.com
Thu Oct 6 18:49:50 EDT 2011


It is possible, and indeed likely. When working with large text strings, every access to the string gets evaluated from the beginning to the end. You can see how this would be extremely time consuming. Arrays however are accessed using a kind of index so when you refer to an element such as myArray[1273] LC knows exactly where that is in memory without having to scan through the data to find it. A string would have to be scanned for a number of carriage returns, line feeds, or both depending on the platform and the format of the string until it arrived at line 1273 and the farther it had to go, the longer it would take. A larger array would not take any longer to find a single element than a very small one. 

Bob


On Oct 6, 2011, at 2:50 PM, Matthias Rebbe wrote:

> Is it really possible, that there is such a performance improvement?
> Maybe this is a cache thing?





More information about the use-livecode mailing list