Performance issues LC8 versus earlier versions.

Monte Goulding monte at appisle.net
Tue Aug 23 19:06:18 EDT 2016


> On 24 Aug 2016, at 8:23 AM, Alex Tweedly <alex at tweedly.net> wrote:
> 
> On 22/08/2016 15:47, Richard Gaskin wrote:
>> Alex Tweedly wrote:
>> 
>> > Would caseSensitive make it faster ?
>> 
>> In theory yes, since it avoids having to run the internal equivalent of toLower on each thing being compared.
>> 
> But since these are bytes, not chars, that doesn't apply.

Yes this was a red herring on my part. Sorry about that.

As far as the test goes it would seem there’s an optimisation the engine could make where when we work out that we have two exact duplicates of binary data in memory we could release one and reference the other. However, this is unlikely to help you all that much.

As for the slowdown I think this may be something we can’t do much about without implementing some kind of binary only comparison operator. After reviewing the code path I see that there is an attempt made to parse the binary value into a number to try and compare numerically before doing the binary comparison. It may be we can change the order here and if both left and right are binary just compare the memory first.

> on mouseUp
>   put URL ("binfile:/Users/alextweedly/Dropbox (Personal)/Pictures/2016/101_0818/IMGP0021.JPG") into tData1
>   put URL ("binfile:/Users/alextweedly/Dropbox (Personal)/Pictures/2016/101_0818/IMGP0021.JPG") into tData2
>   -- put tData1 into tData2
>   put the millisecs into time1
>   repeat 5 times
>      if tData1 = tData2 then
>         add 1 to temp
>      end if
>   end repeat
>   put the number of bytes in tData1 && the millisecs - time1 && temp into msg
> end mouseUp




More information about the Use-livecode mailing list