Refactoring is your friend / moving from 6.x to 9.x

Mark Waddingham mark at livecode.com
Fri Jan 4 03:57:27 EST 2019


On 2019-01-04 09:03, Kay C Lan via use-livecode wrote:
> So what I can't confirm is whether PR6671 has been implemented into a
> current version of LC9, but what I will say is this, if it hasn't then
> Malte can look forward to an eventual speed improvement in large Array
> operations as Mark Wa has already identified this problem and is
> working on a fix.  If it has been implemented then Malte needs to take
> a look at Mark Wa examples and see where he can use some of Mark Wa's
> good code to replace his own poorly performing code.

It hasn't as yet - that PR 
(https://github.com/livecode/livecode/pull/6671) has actually turned 
into a mini-grab bag of things which need to be separated out slightly:

   - reduction of memory usage of the 'handle' structures used to hold 
values (particularly on 64-bit)
   - faster processing of integer index access in arrays
   - faster short-path array access (both storing and fetching)
   - 'static' switch optimization (switches with all literal cases are 
now constant time and not linear in the number of cases)
   - params(<n>[, <m>) which returns an numeric array of parameters <n> 
up to <m>
   - sequence and array literals
   - a try(expr, error-expr) function (evaluates error-expr as the result 
if expr throws)
   - array meta-indexing (tArray[first], tArray[last], tArray[next])

The only one which is unlikely to survive is the meta-indexing as (1) 
they don't quite work correctly and (2) Monte had a better suggestion 
which I've not had a chance to implement.

It also contains benchmarks derived from my talk at LCG on optimization, 
and Curry's which he posted a while back.

Warmest Regards,

Mark.

-- 
Mark Waddingham ~ mark at livecode.com ~ http://www.livecode.com/
LiveCode: Everyone can create apps




More information about the use-livecode mailing list