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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD Beta Forum
The Raven
Magician


Joined: 13 Oct 2000
Posts: 463

PostPosted: Mon Nov 27, 2006 8:45 pm   

Does enabling Verbatim/Case Sensitive Improve Performance?
 
I tend to enable Verbatim or Case Sensitive whenever I can, so that triggers will be faster. Does this make a difference? Is there a significant difference between matching "Foo Bar [Baz]" in verbatim mode, vs "Foo Bar ~[Baz~]" in normal mode?

Raven
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Mon Nov 27, 2006 10:01 pm   
 
In that specific case, no. But plain text is always faster than wildcards as it doesn't go through the parser, and over the course of several complex triggers the difference could possibly be noticeable (there's just so many ways to tweak for speed, however, that you can never be really sure).
_________________
EDIT: I didn't like my old signature
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Mon Nov 27, 2006 10:15 pm   
 
These days there isn't much of a difference. When you use Verbatim, CMUD is using a plain string comparison routine (actually the POS routine in Delphi) to test to see if your verbatim pattern is somewhere in the line. However, the Perl RegEx code is so highly optimized, that it might be able to perform this test even faster than the Pos function in Delphi. So you'd need to experiment to test the difference.

If you use Verbatim mode, and do *not* specify Case Sensitive, then CMUD performs an additional "lowercase" operation on both the pattern and MUD line, so this is slower than using a case-sensitive trigger. Again, when Verbatim is off you are using the Perl RegEx code, and I think it is optimized to handle case sensitive/insensitive with the same speed.

All you can really do is try some tests for yourself.
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Tue Nov 28, 2006 3:13 am   
 
Case likely will in the long run. Verbatim most likely will not. Most REGEX libraries I have dug into actually make use of Assembly level optimizations that can handle a case insensitive comparison as fast as lower-casing a single string of the same length. The case insensitive comparison is still at best 3 times as many opcodes as the case sensitive one.
_________________
The only good questions are the ones we have never answered before.
Search the Forums
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD Beta Forum 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