Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
-
dunbarx
- VIP Livecode Opensource Backer

- Posts: 10305
- Joined: Wed May 06, 2009 2:28 pm
Post
by dunbarx » Fri Dec 18, 2020 9:47 pm
but if the hits are put into a string, and after that is put into the result field it is pretty much the same
Hmmm. 160 ticks is 2.66 seconds. 5 ticks is almost no time at all. How could processing the results of either make the total about the same?
Craig
-
FourthWorld
- VIP Livecode Opensource Backer

- Posts: 10043
- Joined: Sat Apr 08, 2006 7:05 am
-
Contact:
Post
by FourthWorld » Fri Dec 18, 2020 9:49 pm
hpsh wrote: ↑Fri Dec 18, 2020 8:26 pm
for me, 10000 lines of random text, with some hit and misses, takes 5 ticks with the filter variation, and something like 160 with the for each
but if the hits are put into a string, and after that is put into the result field it is pretty much the same
so seems to me it pretty fast, but yeah, the more lines, the slower it will go
An ideal solution maintains performance relative to data size.
And position sometimes matters. In my older comparison where chunk expressions shined the filter was evaluating something like the 15th item out of 20 in each line, where RegEx's generalized parsing was (at least at that time) slightly slower than LC's chunk parsing (at least given the other factors like average item length).
-
hpsh
- Posts: 52
- Joined: Tue Aug 25, 2015 8:06 pm
Post
by hpsh » Fri Dec 18, 2020 10:15 pm
yeah, twice the data, is typically more than twice the time. has tried to do some sorting algorithms, and about 10000 lines seem typical to be painfully slow.
wonder how it would be with a lot more lines, and if something like putting it in an array would help.
-
hpsh
- Posts: 52
- Joined: Tue Aug 25, 2015 8:06 pm
Post
by hpsh » Fri Dec 18, 2020 10:19 pm
Hi Craig, i did it this way
Code: Select all
-- Sent when the mouse is released after clicking
-- pMouseButton specifies which mouse button was pressed
on mouseUp pMouseButton
local mTicks, mText
put the ticks into mTicks
put empty into field "2"
repeat for each line tLine in field "1"
if matchtext(tLine,"[X]\d{5}") then
put tLine&cr after mText
end if
end repeat
put mText into field 2
put the ticks - mTicks into field "time"
end mouseUp
cannot find how to upload the complete source code? did this not used to be a thing?