Re: Livecode performance problem

2022-08-21 Thread Richard Gaskin via use-livecode
Paul Dupuis wrote: > For strange legacy application reasons, when lines get added to the > set of fields (a frequency action by users - sometimes adding hundreds > of lines a day), the data has to be repackaged into this tab delimited > structure in a single variable to run some procedures on. >

Re: Livecode performance problem

2022-08-21 Thread Mark Smith via use-livecode
Wow, what a great example. I decided to work through the various suggestions just so I could get a better grip on some of LC’s more sophisticated data handling commands. My original run using Paul’s example was 8 seconds (2000 lines per field, 1100 chars per line) Applying Brian’s simple

Re: Livecode performance problem

2022-08-20 Thread doc hawk via use-livecode
Short version: inserting between is a much slower process than after, as the entire field/string/whatever from the post of insertion has to be moved or otherwise handled. ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this

Re: Livecode performance problem

2022-08-20 Thread Paul Dupuis via use-livecode
Thank you! The prior solutions have dramatically reduced the time - the WHOLE analytics process in its entirety because of the slowness of my old code was taking HOURS (like 6-10) - and is now down to 30-35 minutes with the prior solutions. I can't wait to tr the combine by columns method to

Re: Livecode performance problem

2022-08-20 Thread Alex Tweedly via use-livecode
I can't answer for anyone else, but for me - because I never thought about it :-) Combine by column - never used it before, so never thought of it. It's significantly faster, roughly 40% improvement over the previous best. Note, the spec requires that each line begins with the line number, so

Re: Livecode performance problem

2022-08-20 Thread David Epstein via use-livecode
I didn’t text the speed, but why not put fld A into x[1] put fld B into x[2] put fld C into x[3] put fld D into x[4] combine x by column return x > > I have a set of fields, call them A, B, C, and D. Each has the same > number of lines. Each field has different text (per line) > > I need to

Re: Livecode performance problem

2022-08-19 Thread Paul Dupuis via use-livecode
On 8/19/2022 7:40 PM, Mark Wieder via use-livecode wrote: On 8/19/22 16:31, Alex Tweedly via use-livecode wrote: to trim about another 15% off the time (for my sample data, 24ms down to 20ms.) Nice. Note, of course, that we're all going on the assumption that all four fields contain the

Re: Livecode performance problem

2022-08-19 Thread Alex Tweedly via use-livecode
On 20/08/2022 00:03, Bob Sneidar via use-livecode wrote: It's probably a lot of text. The engine has to start from the beginning of every string then scan through for every cr or lf or cr/lf or whatever counts as a line break, until if finds the nth one. The more lines, the longer the scan

Re: Livecode performance problem

2022-08-19 Thread Mark Wieder via use-livecode
On 8/19/22 16:03, Bob Sneidar via use-livecode wrote: It's probably a lot of text. The engine has to start from the beginning of every string then scan through for every cr or lf or cr/lf or whatever counts as a line break, until if finds the nth one. The more lines, the longer the scan takes

Re: Livecode performance problem

2022-08-19 Thread Mark Wieder via use-livecode
On 8/19/22 16:31, Alex Tweedly via use-livecode wrote: to trim about another 15% off the time (for my sample data, 24ms down to 20ms.) Nice. Note, of course, that we're all going on the assumption that all four fields contain the same number of lines. -- Mark Wieder ahsoftw...@gmail.com

Re: Livecode performance problem

2022-08-19 Thread Alex Tweedly via use-livecode
On 19/08/2022 23:32, Mark Wieder via use-livecode wrote: It is indeed faster. Here's what I came up with. I'm not sure why 2000 lines of text in four fields should take that long, I came up with original code: 320 ms array version: 21 ms    put empty into vCombined    put fld "A" into v1   

Re: Livecode performance problem

2022-08-19 Thread Bob Sneidar via use-livecode
It's probably a lot of text. The engine has to start from the beginning of every string then scan through for every cr or lf or cr/lf or whatever counts as a line break, until if finds the nth one. The more lines, the longer the scan takes each time, and the more text per line the exponentially

Re: Livecode performance problem

2022-08-19 Thread Mark Wieder via use-livecode
On 8/19/22 15:07, Bob Sneidar via use-livecode wrote: Off the top of my head: split v1 by tab split v2 by tab split v3 by tab split v4 by tab put the keys of v1 into tKeyList sort tKeyList ascending numeric repeat for each line tKey in tKeyList put tKey & tab & v1 [tKey] & tab & v2 [tKey]

Re: Livecode performance problem

2022-08-19 Thread Brian Milby via use-livecode
Based on what Bob said, here is my version of that handler: on mouseUp local tA, tB, tC, tD, tAll, tStart, tEnd put fld "A" into tA put fld "B" into tB put fld "C" into tC put fld "D" into tD -- put the milliseconds into tStart split tA by cr split tB by cr split tC

Re: Livecode performance problem

2022-08-19 Thread Brian Milby via use-livecode
First optimization would be to put … & cr after vCombined and then delete the trailing from when done. Sent from my iPhone > On Aug 19, 2022, at 5:11 PM, Paul Dupuis via use-livecode > wrote: > > I have a set of fields, call them A, B, C, and D. Each has the same number > of lines. Each

Re: Livecode performance problem

2022-08-19 Thread Bob Sneidar via use-livecode
Off the top of my head: split v1 by tab split v2 by tab split v3 by tab split v4 by tab put the keys of v1 into tKeyList sort tKeyList ascending numeric repeat for each line tKey in tKeyList put tKey & tab & v1 [tKey] & tab & v2 [tKey] & tab & v3 [tKey] & tab & v4 [tKey] & cr after

Livecode performance problem

2022-08-19 Thread Paul Dupuis via use-livecode
I have a set of fields, call them A, B, C, and D. Each has the same number of lines. Each field has different text (per line) I need to combine the data - frequently - into a form that look like: C> For the number of lines in the set of fields. Currently I do this as follows: put empty