While this test may be valuable in comparing different versions of LC, I'm not sure how useful the data is by itself. I decided to run a test and see what happened. I defined 6 constants. kA-kE for the size of each loop. kF for the last line in tvar/element in the array. To initialize, I just made it simple and put 1,2,3...kX for the lines and T[1][1] = 1, T[1][2] = 2,... for the array. To add an additional wrinkle, I added additional lines to tvar such that the last line could be 5 or some other number. I'm on an iMac/Sierra running 9.0.1rc1. Times are milliseconds. First line is the constant values. First test is the original from the start of the thread.
34 10 11 10 34 5 item: 4159 / array: 9718 / 0.427969 34 10 11 10 34 50 item: 5200 / array: 10346 / 0.50261 34 10 11 10 34 500 item: 36573 / array: 10298 / 3.551466 340 10 11 10 34 5 item: 81108 / array: 97007 / 0.836105 340 10 11 10 34 50 item: 213107 / array: 103755 / 2.053944 Notice not much relative difference between 5 and 50 lines in the original test (but item did take 20% more time), but when I jumped it to 500 the advantage shifted to array. Notice how linear the array times are when the outer loop is changed - compare test 1 to 4 and 2 to 5. The number of outer loops increased by a factor of 10 and the array time jumped by a factor of 10. Compare to the item where it was 20x and 40x. This is where the advantage of arrays lies - it is constant time to access, so the cost is mainly a factor of the number of reads. I also did the first and third test on 8.1.9 (slightly slower than 9): 34 10 11 10 34 5 item: 4828 / array: 10714 / 0.450625 34 10 11 10 34 500 item: 37806 / array: 11057 / 3.419191 If anyone wants the stack or code, let me know. Thanks, Brian On Mon, Aug 20, 2018 at 4:03 PM, Curry Kenworthy via use-livecode < use-livecode@lists.runrev.com> wrote: > > Hey Folks, > > Of course I'm interested in this thread. Always a big concern. Earlier > this year, and last year, I was doing face-off competitions between > LiveCode versions to test how optimization is faring. > > When I get time, after some other priorities and addon updates, I would > like to do another round of cross-version testing to see who is the current > champion. (IIRC, I think 6.7 was last time, for Windows.) > > Meanwhile.... > > jbv: > > > the same data on LC 6.5.2 desktop Mac, and arrays run 20% faster > > than items... On LC9 server I get opposite results : items are > > 2 times faster then arrays. > > 1. Try LC 6.5 desktop vs LC 9 desktop: how does that fare? And maybe LC 9 > desktop vs LC 9 server? I would like to distinguish LC 6/9 from LC > desktop/server. Apples to apples testing, then conclusions are possible. > > 2. Sample code stack would be great. > > Mark T.: > > > I wrote a stack that demonstrated this and other concepts for > > LC Mark directly. His Global talks called ‘Optimizing Your Code’ > > are partially based on some things we have been discussing. > > Optimizing our code is a good thing, and something I am paranoid about and > specialize in helping people with. Optimizing LC's own code is also a good > thing, and really the bigger question here perhaps for this thread! > > So...I'll be quietly following this thread. No time to participate yet, > but will later. > > Best wishes, > > Curry Kenworthy > > Custom Software Development > LiveCode Training and Consulting > http://livecodeconsulting.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 > _______________________________________________ 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