[618] in Coldmud discussion meeting

root meeting help first first in chain previous in chain previous next last

Re: speed ping

daemon@ATHENA.MIT.EDU (Mon Dec 12 16:53:35 1994 )

From: Alex Stewart <riche@crl.com>
To: brandon@avon.declab.usu.edu
Date: Mon, 12 Dec 1994 13:49:29 -0800 (PST)
Cc: coldstuff@MIT.EDU
In-Reply-To: <9412122103.AA02217@avon.declab.usu.edu> from "brandon@avon.declab.usu.edu" at Dec 12, 94 02:02:54 pm

> What I was asking is what would be faster, using match template or tossing
> it into a dictionary.  It will work, as the templates I would be using in
> the dictionary would only be 1 word long.

Well, it seems to me that should be fairly obvious.  Dictionary lookup is done
internal to the server using hash tables and optimized C code, as opposed to
match_template which has to run through a ColdC interpreted loop using a
routine which has to do a pattern match on every instance to see if it matches.
OF COURSE dictionary lookup will be faster, unless you're doing something silly
like creating the dictionary from the templates every time you want to match

Of course it'll take up a lot more storage space..

> (PLEASE stop trying to assume you know what I'm talking about).

Oh, come on, Brandon.  PLEASE stop jumping on Crag for perfectly legitimate
questions.  I was going to ask the same thing.

     Alex Stewart - riche@crl.com - Richelieu @ Diversity University MOO