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

# A few optimization questions...

- Date: Fri, 3 May 1996 18:42:22 PDT
- From:
- Reply-To:
- Content-Type: TEXT/PLAIN; charset=US-ASCII

    I've been optimizing some of my code and I was just wondering about a few
    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"}

    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> }
    Yes, I know value_hash() wasn't made for this kind of thing, but it's
    still faster than making a hash in-DB.

    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]
                                                            --Dark_Owl

Follow-Ups:

- Re: A few optimization questions...

- From: Pavel Curtis <pavel@parc.xerox.com>

- Re: A few optimization questions...

- From: cadams@weather.brockport.edu (Chuck Adams)

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

Home | Subject Index | Thread Index