surprising filter benchmarks
Alex Tweedly
alex at tweedly.net
Tue Jul 12 17:17:05 EDT 2005
Richard Gaskin wrote:
>
> I figured the filter command would carry at least some overhead for
> its convenience, but I had no idea how much!
>
> I wrote the test below to compare it with walking through a list line
> by line, and the results were surprising:
>
> on mouseUp
> put fwdbCurTableData() into s -- gets 10,800 lines of
> -- tab-delimited data
> --
> -- Method 1: filter command
> --
> put format("*a*\t*r*\tr\t*\t*\t*\t*\t*") into tFilter
> put s into result1
Richard, I'm too busy (lazy??) to create some data and test this for
timings right now, but this filter is more complex than you need - it
verifies that there are the right number of tabs. You could simplify it to
put format("*a*\t*r*\tr\t*") into tFilter
and should get the same results more quickly.
-- Alex.
--
Alex Tweedly http://www.tweedly.net
--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.323 / Virus Database: 267.8.12/46 - Release Date: 11/07/2005
More information about the use-livecode
mailing list