Lynch, Jonathan wrote:

Interesting - so 'is not in' was actually faster than lineoffset! Is
that always the case?

What if you use this:

If matchtext(Gorp,AnElement) = false then...
I'd expect that to be slow - matchtext is going to invoke a general purpose regex handler - fast for what it does, but slow compared to simpler code that just does exact matches on strings.

It's unsurprising that "is not in" would be faster than "lineoffset"m because "is in" (or "is not in") can use string searching algorithms, which have been extensively studied and optimized, whereas lineoffset must either do
 - string search followed by a count of the number of cr's
or
 - loop through the lines, doing a string search within each.

Either way, the simple string search would normally be faster - but I wouldn't say "always" faster, there's bound to be some corner case where it isn't.

--
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.9.0/50 - Release Date: 16/07/2005

_______________________________________________
use-revolution mailing list
[email protected]
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution

Reply via email to