Page 1 of 1

Slow stack needs speed

Posted: Sat Oct 01, 2016 12:37 am
by RossG
Attached a stack which I would like to go faster.

I guess that re-building the array in each of the
functions ROTT16 to ROTT36 is the bottle-neck.

Load a file - some samples included.

Suggestions welcome.

Re: Slow stack needs speed

Posted: Sat Oct 01, 2016 4:30 am
by dunbarx
I am going to have to at least keep a v8 LC around. So many queries involve stacks I cannot open.

Sorry. But someone will chime in soon

Craig Newman

Re: Slow stack needs speed

Posted: Sat Oct 01, 2016 7:46 am
by RossG
Craig

LC 7.1.2 should do it.

Re: Slow stack needs speed

Posted: Sat Oct 01, 2016 5:59 pm
by FourthWorld
@Ross: I can often make time to revise code that may benefit from optimization, but your apps has hundreds of controls and no clear path to focus on. I started to look in one button script, but found that it was sending messages to some 36 other buttons that I can't find there. Not sure how to meaningfully proceed, but while I was poking around I found a few things that will likely boost performance by at least an order of magnitude:
- Within loops, work in variables rather than on the field directly; put the result into the field when the loop is done; field operations are FAR more expensive than variables.
- Use the "repeat for each" loop form instead of "repeat with i = 1 to..." wherever practical.

These are other tips are outlined here, a wonderful thread that wound up covering a wide range of useful optimization tips that brought a routine that used to take 9 minutes down to a few milliseconds:
http://forums.livecode.com/viewtopic.php?f=8&t=24945


@Craig: v7 is generally much slower than v6 or v8.1. Since v8.1 includes some 2800+ enhancements and fixes not found in the now-discontinued v6, and several hundred since the last of the now-discontinued v7 series, it's an efficient and robust option. And since it's currently maintained, it's arguably the best option for work going forward, since OS APIs change frequently and engine updates will be needed to stay on top of those.