function for greatest object in list less than or equal to a value

Peter TB Brett peter.brett at livecode.com
Tue Oct 13 10:41:32 EDT 2015


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.

>  > 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.

                                   Peter

-- 
Dr Peter Brett <peter.brett at livecode.com>
LiveCode Open Source Team

LiveCode on reddit: https://reddit.com/r/livecode




More information about the use-livecode mailing list