Page 1 of 1

Conversion to Livecode 8+

Posted: Tue Dec 27, 2016 5:15 pm
by jpm
Hi. I've been scripting in LC 6+ for some time but now I wish to convert my stacks over to LC8. It seems slower for most things. For example, the script combo below used to take about 5 seconds and now, in LC8, takes about 20 seconds. Is there anything I should be doing to speed things up?

function theLibraryScripts p1,p2,p3
put empty into t1
put the libraries into t2
repeat for each line x in t2
put (the script of stack x) & cr after t1
end repeat
return t1
end theLibraryScripts

on theLibraryScripts p1,p2,p3
put theLibraryScripts(p1,p2,p3) into field 1
end theLibraryScripts

Also, I'd bet that someone has a note sheet for LC8 conversion if you wish to share it.

Thanks, Joseph

Re: Conversion to Livecode 8+

Posted: Tue Dec 27, 2016 6:22 pm
by FourthWorld
What's in the arguments p1, p2, and p3, and why are they being passed to theLibraryScripts but not used there?

Also, how did you measure the time? Could it be that some of that may be taking place outside of these two handlers, in the handlers that call them?

Re: Conversion to Livecode 8+

Posted: Tue Dec 27, 2016 7:03 pm
by jpm
FourthWorld wrote:What's in the arguments p1, p2, and p3, and why are they being passed to theLibraryScripts but not used there?
Also, how did you measure the time? Could it be that some of that may be taking place outside of these two handlers, in the handlers that call them?
The params p1,p2, and p3 are just placeholders in case later I wish to add arguments later. I tried commenting them out on both handlers, but there's no change.

I measured the time by putting the seconds/start time and end time into globals gBench[1] and gBench[2] and subtracting the difference, but I also tried it without benching the time just by looking at a clock and it's pretty much the same.

Re: Conversion to Livecode 8+

Posted: Tue Dec 27, 2016 7:19 pm
by jpm
Oops, my bad.

Previously, I had called a separate handler that created a field to put the data into. Your response made me think twice, and when I put it straight into the field without the createField handler it was instantaneous. I'll review the previous handler and see if I can catch the delay there. Thanks, Joseph