|
jake5005 Newbie
Joined: 10 Mar 2004 Posts: 1
|
Posted: Wed Mar 10, 2004 3:27 pm
Old triggers in Zmud 7.03+ |
I know that the old triggers work in the new ZMUD. And that they should be faster, because ZMUD uses the PCRE library to execute the old triggers faster.
My question is:
Would the old triggers be even faster, if one would change them to new Perl regular expressions by hand or are the old triggers just as fast as the new Perl ones because ZMUD changes them internally?
Regards,
Jake |
|
|
|
Rorso Wizard
Joined: 14 Oct 2000 Posts: 1368
|
Posted: Wed Mar 10, 2004 4:22 pm |
quote: Originally posted by jake5005
I know that the old triggers work in the new ZMUD. And that they should be faster, because ZMUD uses the PCRE library to execute the old triggers faster.
My question is:
Would the old triggers be even faster, if one would change them to new Perl regular expressions by hand or are the old triggers just as fast as the new Perl ones because ZMUD changes them internally?
Regards,
Jake
zMUD translates the zMUD pattern -> perl-pattern. Most zMUD patterns are quite small though so this translation should be pretty fast.
On the other hand if you have many patterns zMUD have to go through them all until it finds a match. So the time to do the translation increases with the length, and amount of patterns.
It is possible though that zMUD caches old translations. |
|
|
|
Fewyn Wanderer
Joined: 27 Sep 2002 Posts: 83
|
Posted: Thu Mar 11, 2004 2:41 am |
Then i got a question on this topic... how would someone convert a trigger to work exactly like it did but uses the new Perl expressions then the old ones? Any easy way of doing this?
|
|
|
|
Arminas Wizard
Joined: 11 Jul 2002 Posts: 1265 Location: USA
|
Posted: Mon Mar 15, 2004 5:16 am |
Zugg changed that so when Zmud converts the old trigger it only convertst it ONCE per save. That is when you save your old pattern, or use the old pattern matching language Zmud converts it to perl in the background on save. So if you like to use the old zmud language you still get the speed up.
There are things you can't do with the old language and lots of people already know perl, but most importanly it is FASTER those are the reasons Zugg changed how zmud works internally.
If you import old settings or make your patterns with the old language Zmud displays it in that language in case you don't know perl or don't want to learn it[8D].
But you get the speedup weather you like it or not; the question is who wouldn't like it? |
|
|
|
reltuk Newbie
Joined: 19 Jan 2003 Posts: 6 Location: USA
|
Posted: Mon Mar 15, 2004 11:45 pm |
No need to learn Perl, just Perl regular expressions...they're very powerful, and you would probably benifit from learning them just because they are expressive, flexible and common (PCRE, the library Zugg used, it becoming quite common). For a run down of Perl regular expression syntax, take a look at perldoc, most notably http://www.perldoc.com/perl5.8.0/pod/perlre.html .
--
reltuk |
|
|
|
Vittorio Beginner
Joined: 22 Oct 2003 Posts: 10
|
Posted: Tue Mar 16, 2004 4:32 am |
erm, when you say use Perl regular expressions.. that means using #REGEX instead of #TRIGGER?
Would conditions still work with #REGEX? |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Tue Mar 16, 2004 7:45 pm |
Yes. #CONDITION will add a state to a #REGEX trigger. If you want the #CONDITION to use a regex pattern, use the Regex option. Regex can be combined with other trigger (condition) types, such as Within or Looplines.
|
|
|
|
|
|