|
The Raven Magician
Joined: 13 Oct 2000 Posts: 463
|
Posted: 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 |
|
|
|
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: 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 |
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: 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. |
|
|
|
Vijilante SubAdmin
Joined: 18 Nov 2001 Posts: 5182
|
Posted: 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 |
|
|
|
|
|