which is faster for searching?

Peter Haworth pete at lcsql.com
Sat Aug 30 15:55:10 EDT 2014


Seems like the times you're getting are a lot longer than I'd expect even
allowing for repeat with performance so maybe that's it.

Perhaps it's a factor of the condition you're testing for and how many
lines are deleted.

Pete
lcSQL Software <http://www.lcsql.com>
Home of lcStackBrowser <http://www.lcsql.com/lcstackbrowser.html> and
SQLiteAdmin <http://www.lcsql.com/sqliteadmin.html>


On Sat, Aug 30, 2014 at 10:05 AM, Mike Bonner <bonnmike at gmail.com> wrote:

> Hugh, just did a test.. Rather than putting empty into the line and then
> filtering without empty, seems to be quite a bit faster to "then delete
> line x of tVar"
>
> Still has the slowdown caused by accessing the lines of the var using "line
> x of.." but saves the time for the filter. With the data I generated for
> the test, 100k lines, the delete method took 5.3 secs, the filter method
> took 14.5.
>
> The system i'm on at the moment, only has LC 6.6.2 though, and I seem to
> remember someone mentioning large speed differences depending on LC
> version, so if i'm running into that, someone let me know.  Or if there is
> a reason to NOT directly delete the line, let me know that too.
>
>
> On Sat, Aug 30, 2014 at 1:45 AM, FlexibleLearning.com <
> admin at flexiblelearning.com> wrote:
>
> > Peter Haworth <pete at lcsql.com> wrote
> >
> > > There's another situation where I use repeat with even though it's a
> > little
> > > slower than repeat for and I also alter the contents of the data I'm
> > > repeating through without any problems.
> > >
> > > repeat with x=the number of lines in tVar down to to 1
> > >    if <data condition on  line x of tVar> then
> > >       delete line x of tVar
> > >    end if
> > > end repeat
> >
> > This is an insightful observation. Nice one, Pete!
> >
> > My stock method (and presumably the method you allude to above) is...
> >
> > repeat for each line L in tVar
> >     add 1 to x
> >     if <data condition on  L> then put "" into line x of tVar
> > end repeat
> > filter tVar without empty
> >
> > Both methods operate on a single data set and avoid putting the output
> into
> > a second variable which, for large datasets, involve an unnecessary
> memory
> > overhead..
> >
> > Hugh Senior
> > FLCo
> >
> >
> >
> > _______________________________________________
> > use-livecode mailing list
> > use-livecode at lists.runrev.com
> > Please visit this url to subscribe, unsubscribe and manage your
> > subscription preferences:
> > http://lists.runrev.com/mailman/listinfo/use-livecode
> >
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>



More information about the use-livecode mailing list