[MUD-Dev] Processor Usage

Dominic J. Eidson sauron at the-infinite.org
Fri Mar 3 13:43:25 New Zealand Daylight Time 2000

On Fri, 3 Mar 2000, Christopher Kohnert wrote:

> Am I simply missing something, or do all these engines that report low
> processor usage (5-10% peak) not have a pseudo-real-time event
> scheduling mechanism?  I can sleep, waiting for both events and input
> from sockets, and not get it to drop below an average of 80%.  Does
> anyone have any ideas as to how other systems can claim these low
> usages?  No, I don't have any specific examples, (I can't remember them)
> I've just seen them float by on messages here and there, reporting this
> wonderful feat.

What percentage CPU utilisation you have, largely relies on what kind of
machine you run the engine on - my current project-in-the-works was using
approx. 3-7% CPU on our server machine (K6-2/300MHz) while processing in
the range of 400-450 events/second (and waiting for socket input), whereas
I suspect if I tried to run the same test on my home gateway box (p166),
it would consume quite a bit more CPU.

To say something about the test scenario - upon boot, I spawn off 20000
events scheduled to be ripe between 30 and 60 seconds (N) into the future.
Each event, upon execution, reissues itself for another N seconds into the

What the events do is fairly simple - half of them move an object (Bouncy
the ball) from one room to a random adjacent room, the other half moved an
NPC (Clancy the clown) to a random adjacent room.

The event system I use, is a slightly modified version of Jon Leonard's
implementation that he uses for devmud, (http://frost.slimy.com/devmud/)
and uses a heap to store the events on. (Since I'm still working on
understanding priority queues et al, I'll nochalantly step back and let
those who are more familiar with it take over...)

Dominic J. Eidson
                                         "Baruk Khazad! Khazad ai-menu!" - Gimli
http://www.the-infinite.org/               http://www.the-infinite.org/~dominic/

MUD-Dev maillist  -  MUD-Dev at kanga.nu

More information about the MUD-Dev mailing list