[Prev][Next][Index][Thread]

# Re: A few optimization questions...

- Date: Fri, 3 May 1996 19:40:37 PDT
- From:
- Cc: moo-cows@parc.xerox.com
- In-reply-to: Don Schwarz's message of "Fri, 03 May 1996 18:42:22 PDT" <Pine.LNX.3.91.960503200743.1012A-100000@darkowl.pr.mcs.net>

    Don Schwarz writes:
    > things... First of all, is something like:
    >   index("DF-BP-FC-BC-PP-PH-UL-IN", "BP")
    > significantly faster than:
    >   "BP" in {"DF", "BP", "FC", "BC", "PP", "PH", "UL", "IN"}

    Yes, because the server is stupid and reconstructs that list of strings each
    time this expression is evaluated.  If the list was already computed and, say,
    stored in a property, then these two would be very close in speed.

    > Also, is:
    >   <some large string> in { <a list of about 25 equally large strings> }
    > faster (and less CPU intensive) than:
    >   string_hash( <some large string> ) in { <a list of 25 MD5 hashes> }

    Good god, yes!  All of the MD5 functions are *much* slower than the other
    simple operations.  Have you *seen* the complexity of that function?!

    > And lastly, would it be worthwhile to write a special built-in function for
    > something that runs approx. 10 times per call to $player:notify, to be used
    > instead of:
    >   match(foo, "%[%w%w:[a-zA-Z0-9:_]*%]")[1..2]

    Gack!  It would be better to simply get rid of the necessity to do this on
    every :notify.  It's not terrible, but it's not great, either.  Writing this as
    a built-in would not be trivial, though.

    	Pavel

Follow-Ups:

- Re: A few optimization questions...

- From: Don Schwarz <darkowl@darkowl.pr.mcs.net>

References:

- A few optimization questions...

- From: Don Schwarz <darkowl@darkowl.pr.mcs.net>

- Prev: A few optimization questions...
- Next: Re: A few optimization questions...
- Index: MOO-cows
- Thread: MOO-cows

Home | Subject Index | Thread Index