Regex (MatchText) speed

Troy Rollins troy at rpsystems.net
Thu Jun 24 02:27:41 EDT 2004


On Jun 24, 2004, at 1:49 AM, Brian Yennie wrote:

> For example, if I wanted to remove HTML tags from text, I'd probably 
> use something hand-crafted for speed. If I wanted to verify a valid 
> URL in a strict standards-compliant sense, I'd probably drop in the 
> nasty RegEx because I wouldn't trust my hand-crafted code to catch 
> everything without a ton of effort.

"Hand crafted for speed" that is the part I'm going to have to nail 
down, through some testing. In other tools I work with, the regex 
almost always comes out on top, especially after the first round, since 
patterns have been cached in the engine. It is sounding to me as though 
in Rev that might not be the case, and a couple hundred lines of "hand 
parsing" may actually be faster than a single line matchText and a 
bunch of fillable back references. Given Rev's string-based nature, I'm 
not totally surprised if that is the case. Well... I'm pretty 
surprised, but not totally.

I really don't want to try optimizing this twice (it is big), so if 
anyone has actual experience at comparing the two "for speed", I'd 
still take any input at all. At this point I'm figuring to do this part 
later tomorrow or Friday, so cast yer votes!  ;-)
--
Troy
RPSystems, Ltd.
http://www.rpsystems.net



More information about the use-livecode mailing list