Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
cingulli
Wanderer


Joined: 30 Aug 2001
Posts: 53
Location: Finland

PostPosted: Wed Jul 31, 2002 4:09 pm   

Which is quicker: one trigger or many triggers?
 
Will zmud work more quickly if you use only one trigger:
#tr {car|cat|cool} {#co bold,blue}
or if you put them in different triggers like:
#tr {car} {#co bold,blue}
#tr {cat} {#co bold,blue}
#tr {cool} {#co bold,blue}

?
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Wed Jul 31, 2002 6:31 pm   
 
The second form should be faster but the difference shouldn't be noticeable. Also, in the latests versions of zMUD, the first form had some optimizations made and thus the difference between the two is even less.

Kjata
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Thu Aug 01, 2002 12:16 am   
 
From what Zugg has stated of the optimizations I expect the first form should be faster as of the next public release (or current beta if you wan't to risk your settings). In the current public version, the second form is slightly faster. Of course I can not not be definite on that without violating the liscense agreement.
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Thu Aug 01, 2002 12:00 pm   
 
The first one is faster than it previously was in the current beta because of optimization, but it still is not as fast as using multiple text-only triggers. The reason for this is that any trigger that contains any wildcard or pattern expression (like the {list} syntax) gets sent to a different, slower parser that text-only triggers. More specifically, zMUD first tries to discard a line using any text that the pattern of the trigger contains. If the line is still not discarded and the pattern contains any wildcards or pattern expressions, it gets sent to the other parser. With the second form, none of the triggers would ever reach the other parser while the first form would get sent straight to it. However, it should also be noted (and I can't back this up as I didn't code zMUD) that, in the current beta, as the size of the list grows (meaning more and more separate triggers in the second form), the first form would be faster since zMUD doesn't have to go agaisnt each trigger checking for a match, it just sends the whole list to the second parser which will create a hash table of all the items in the list and use that to find a match. But, again, the difference in speed shouldn't be noticeable at all.

Kjata
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net