[MUD-Dev] Python script as stand alone MUD server...
Kwon J. Ekstrom
justice at softhome.net
Thu Jan 29 11:16:58 New Zealand Daylight Time 2004
I'm somewhat replying to 2 posts here...
Sean Middleditch wrote:
> Probably the place it'll show up the worst is in math intensive
> code, because each math instruction in Python code turns in dozens
> and dozens of machine instructions as the VM interprets the byte
> code. Or any tight loops that are run many times per "frame" (altho
> these usually indicate piss poor design outside of a few specialized
> use cases).
Which was obviously the case considering the followup posting of:
Alistair Riddoch wrote:
> We are dealing with full 3D free form coordinates and some
> pretty neat AI code, though there was no physics to speak of at
> that stage. A lot of the CPU time was propagating events between
> entities. My example here was not intended to be indicative of
> the kind of load a text MUD server written in Python could
> Hardware has got a lot faster since the PII 266 I used to run
> the Python server on back in 2000.
> As to the poster who commented that Python wasn't capable of
> handling more than 12 mobs/players per server - your Python coder
> is clearly incompetent, no matter what you or he thinks. Python
> server applications exist that handle loads no production MUD
> server would dream of handling today.
Admittedly, that email arrived only 25 minutes before yours
did... However, I don't see how poor performance issues are a clear
indicator of the incompetence of the programmer. Especially when it
has been resolved.
Zach Collins wrote:
> Python at the time probably was. Current versions of C Python >
> tend to clock in at between two and twenty times slower than C >
> for most operations, depending on how well your code is >
> optimised. I haven't personally been paying attention to >
> Stackless, so I couldn't say how fast it is.
I'm interested in knowing what types of algorithms you used to solve
this performance issue.
Just from the short bit of information given, I'm guessing that you
were searching the local space for each "object" to pick up events.
Personally I'd have maintained a local cache of objects. When an
event occured, I would then build a list of those "potentially" in
range, then do the spatial search to verify.
-- Kwon J. Ekstrom
MUD-Dev mailing list
MUD-Dev at kanga.nu
More information about the MUD-Dev