WHY is python slow?

Glen Starchman glen at enabledventures.com
Fri Jun 8 18:46:33 EDT 2001


Kemp Randy-W18971 wrote:
> 
> So many factors, they are too long to mention.  Machine you are running on.  Operating system.  Other processes or programs running.  Termites chewing on the computer circuits.  Maybe your watch has stopped.  The Zen nature of interpreters.

Time for a history lesson:

When Guido first began working on Python, he was using a lowly 286
with 2MB of memory. Henceforth, he was used to his Python scripts
running at a certain speed. So as not to shock himself with the
performance of his new language, he created a function that would
make his interpreter more steadfast:

void slow(long milliseconds)
{
    sleep(milliseconds);
}

As time went on, and his development machines got faster and faster,
the more places he found himself placing calls to the slow method,
and the longer and longer the milleseconds parameter became. At last
count, there are 1400 calls to slow in pythonrun.c alone, with an
average millesecond param of 500! 

Someday some brave soul will remove all of those slow calls and
Python will be several orders of magnitude faster.



More information about the Python-list mailing list