MOO-cows Mailing List Archive

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

A few optimization questions...



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:

Home | Subject Index | Thread Index