function for greatest object in list less than or equal to a value
Richard Gaskin
ambassador at fourthworld.com
Tue Oct 13 11:40:28 EDT 2015
Peter TB Brett wrote:
> On 13/10/2015 15:33, Richard Gaskin wrote:
>> Peter TB Brett wrote:
>>
>> > On 13/10/2015 14:42, hh wrote:
>> >> There is an interesting difference between LC versions 6 and 7.
>> >>...
>> >> [a] LC 6.7.7
>> >> repeat-PMB 0.326 <- fastest
>> >> repeat-GC 0.350
>> >> repeat-hh 0.445
>> >> sort-GC 0.985
>> >>
>> >> [b] LC 7.1.0
>> >> repeat-PMB 3.562
>> >> repeat-GC 1.483 <- fastest, the only one with a factor < 9
>> >> repeat-hh 1163.0 <- an ARRAY BUG? :-(
>> >> sort-GC 8.156
>> >
>> > There's no array bug -- it's an aspect of its intentional behaviour.
>> > Appending to an element of an array always causes a copy, so you get
>> > O(N^2) complexity.
>>
>> Thanks for the background, Peter, but what accounts for the difference
>> between version (v6 @ 0.445ms vs v7 @ 1163.0ms)?
>
> I don't know anything about the way arrays are implemented in LiveCode
> 6.x, so I can't tell you how they've changed.
I keep hoping to find some time to learn C++ well enough to figure out
things like that on my own, but between bash and JavaScript and Python
already filling my weekends it's been hard to get the time. Hopefully
one day...
>> > Please re-test in LiveCode 8.0.0-dp-7, because there are some large
>> > performance optimisations in that release that may affect these
>> > results.
>>
>> Being part of LiveCode Script and not specific to Builder, will these
>> changes also be in v7.x?
>
> The changes will be in 7.1.1-rc-1.
Super-cool, Peter. Thanks!
--
Richard Gaskin
Fourth World Systems
Software Design and Development for the Desktop, Mobile, and the Web
____________________________________________________________________
Ambassador at FourthWorld.com http://www.FourthWorld.com
More information about the use-livecode
mailing list