Conversion to Livecode 8+

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
jpm
Posts: 5
Joined: Tue Nov 01, 2016 6:35 pm

Conversion to Livecode 8+

Post by jpm » Tue Dec 27, 2016 5:15 pm

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

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10049
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: Conversion to Livecode 8+

Post by FourthWorld » Tue Dec 27, 2016 6:22 pm

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?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

jpm
Posts: 5
Joined: Tue Nov 01, 2016 6:35 pm

Re: Conversion to Livecode 8+

Post by jpm » Tue Dec 27, 2016 7:03 pm

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.

jpm
Posts: 5
Joined: Tue Nov 01, 2016 6:35 pm

Re: Conversion to Livecode 8+

Post by jpm » Tue Dec 27, 2016 7:19 pm

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

Post Reply