Python speed

Greg Copeland gtcopeland at earthlink.net
Thu Jul 12 21:33:20 EDT 2001


jcm <grumble at usa.net> writes:

> 
> Well, I say this because I've written a mud engine in Python and it's
> slow.  Using this engine on a PII 266 running RedHat 6.1, 400
> wandering monsters (with nothing else going on in the mud) will peg
> the cpu.  In a production mud, you might want to do something
> intelligent about wandering monsters (like have them stop wandering if
> no players are nearby to save cpu-time), but there will also be lots
> else going on.
> 
> There might be some clever optimizations that could be made.  Anyway,
> my only point was that computation-speed can become an issue.

Don't take this the wrong way, but you shouldn't expect the language of
choice to make up for what sounds like a poor design.  No matter what
language you use, you have to have a sound design that will meet all of
your requirements (speed and scalability included).  Once you have a good
design, python makes for an excellent prototype bench.  See how well it
runs and profile it.  The areas that still don't perform well, many
need to be optimized either via redesign or re-implementation of existing
design.  If after all that is done, and you KNOW you have a good design,
but python still isn't up to the task, well then you know that another
scripting language probably wouldn't of fit the bill either.  Now, you
have an excellent design and a fast working prototype, so now you are
free to reimplement in another, faster language (C, C++, pascal, etc).

Greg





More information about the Python-list mailing list