Regex (MatchText) speed

Ken Ray kray at sonsothunder.com
Fri Jun 25 02:43:11 EDT 2004


For a whole bunch of ways to increase performance, check out Wil Dijkstra's
awesome research into increasing script performance:

Increasing Script Performance, Part I
  http://www.sonsothunder.com/devres/revolution/revolution.htm?_scrp005

Increasing Script Performance, Part II
  http://www.sonsothunder.com/devres/revolution/revolution.htm?_scrp006

Increasing Script Performance, Part III
  http://www.sonsothunder.com/devres/revolution/revolution.htm?_scrp007

An excellent read!

HTH,

Ken Ray
Sons of Thunder Software
Email: kray at sonsothunder.com
Web Site: http://www.sonsothunder.com/


> -----Original Message-----
> From: use-revolution-bounces at lists.runrev.com 
> [mailto:use-revolution-bounces at lists.runrev.com] On Behalf Of 
> Brian Yennie
> Sent: Thursday, June 24, 2004 1:58 AM
> To: How to use Revolution
> Subject: Re: Regex (MatchText) speed
> 
> 
> > take any input at all. At this point I'm figuring to do this part
> > later tomorrow or Friday, so cast yer votes!  ;-)
> 
> Well, here are a few tips for the bucket:
> 
> 1) Offset() is the fastest call you've got. Try to avoid lineOffset() 
> or itemOffset() if possible. "Contains" can also be slower, for some 
> reason.
> 
> 2) Determine if you need case-sensitivity. Setting the 
> caseSensitive to 
> TRUE (it's FALSE by default) provides around a 50% speedup by itself. 
> Of course you can only use it if you actually are doing case 
> sensitive 
> work, OR you are able to convert things with upper() or lower() first 
> and then restore them later in a clever fashion.
> 
> 3) If things get complicated, consider using state variables to track 
> where you are
> 
> 4) Try to do everything in one pass (or as few as possible) 
> if the data 
> is large
> 
> 5) Always use "repeat for each" when looping, not "repeat with"
> 
> 6) If you've got it working and it just needs a little more pumping, 
> people on list (who me?) tend to like to optimize things that get 
> posted here provided that the poster has taken a good wack at 
> it first 
> =).
> 
> HTH,
> - Brian
> 
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com 
> http://lists.runrev.com/mailman/listinfo/use-revolution
> 




More information about the use-livecode mailing list