speed
Beat Cornaz
B.Cornaz at gmx.net
Thu Aug 21 16:16:39 EDT 2014
A while ago I did a test for speed with 'repeat for'. It turned out that with items it worked the fasted. Chars were slower and words even more so.
Now I redid the test with 'LineOffset'. To my surprise: with chars was considerably faster.
A long list with lines like 'aabcbcax' (chars) OR "a,a,b,c,b,ca,x," (items) and finding a specific line gave the following time results in ticks (depending on how deep down the wanted line was in the list ) :
items chars
57 42
4530 2871
2908 2087
24 15
I did the lineOffset for 1 specific string and repeated the lineOffset 100000 times. The variation with the chars was about 1.35 to 1.6 times as fast as the variation with items.
Can anybody confirm this from experience and maybe explain why the LineOffset works faster with strings of chars, while the repeat for works faster with items?
I would also appreciate any other insights in how to speed up routines, as I am working a a program with Evolutionary Algorithms and I need to do hundred of thousands of calculations in each run, so speed is quite important.
Cheers, Beat
More information about the use-livecode
mailing list