MOO-cows Mailing List Archive


Re: [SERVER] LambdaMOO 1.8.x feature wishlist

Your message dated: Mon, 11 Nov 96 02:50:56 PST
> (1) Security.
>      Limit string and list lengths to prevent malicious programmers
>      (or unfortunate accidents) from bringing down any MOO currently in 
>      existence.

Yeah, in addition to being able to bring down the MOO accidentally or
malicously, really long properties can cause killer performance problems.  We
recently had an intermittent lag problem.  We traced it to a listening device
that was adding everything it heard to a list, and had grown to almost 5000
items long.  Whenever anyone was in that room, the whole MOO slowed down.

Here's the verb I used to find it:

"Syntax: long_props([max length])";
"Finds all properties in the db longer than max length.";
"Max length defaults to 500";
"This code must be owned by a wizard";
"Amy Bruckman,, 11/96";
if (!caller_perms().wizard)
  return E_PERM;
long = args ? arg[1] | 500;
all = $object_utils:descendents_suspended(#1);
result = {};
for item in (all)
  $command_utils:suspend_if_needed(0, item);
  props = $object_utils:all_properties(item);
  for p in (props)
    $command_utils:suspend_if_needed(0, item);
    value = item.(p);
    if (typeof(value) == LIST && (l = length(value)) > long)
      result = {@result, {l, item, p}};
result = $list_utils:sort_alist_suspended(0, result);
for item in (result)
  player:tell($string_utils:nn(item[2]), ".", item[3], ": ", item[1]);
player:tell(length(result), " properties longer than ", long, ".");

I find it useful to run this once in a while.  A lot of people don't realize
how evil really long lists are.  (Anyone know how the time required
for list operations changes with respect to their length?  Pavel told me
once a long time ago...  I seem to remember that it was worse than order

By the way, $wiz_utils.missed_help_strings will probably be near the top of
the list on most MOOs.  I turned off keeping track of missed help strings on
MediaMOO.  On MOOSE Crossing, I keep thinking I'll go through them, but I
never do.  Maybe LambdaCore should implement that feature in a more
efficient way...  (Another project I'll never get around to!)

-- Amy

p.s. I'm a clue-cows reader.  Please cc me directly on any replies!

Follow-Ups: References:

Home | Subject Index | Thread Index