Python IS slow ! [was] Re: Python too slow for real world

Markus Kohler markus_kohler at hp.com
Tue May 4 06:17:18 EDT 1999


>>>>> "Guido" == Guido van Rossum <guido at eric.cnri.reston.va.us> writes:

    Guido> Markus Kohler <markus_kohler at hp.com> writes:
    >> >>>>> "Marko" == Marko Schulz
    >> <4mschulz at informatik.uni-hamburg.de> writes:
    >> 
    Marko> Markus Kohler <markus_kohler at hp.com> wrote:
    >> >> Python-1.5.2c1 ....  0.52 seconds >> >> Squeak ....  0.13
    >> seconds.
    >> 
    Marko> I wouldn't put too much meaning in this number. You can't
    Marko> say how big the startup costs are for a python vs. squeak.
    >>  I'm not really interested in the startup costs. One can make
    >> them near zero for squeak, by compiling the image into an
    >> executable.  These are the times without startup costs.

    Guido> Markus, I think Marko was asking how you measured the
    Guido> times.  If you used something like "time python bench.py"
    Guido> you were measuring Python's (considerable) start-up time,
    Guido> and you are misrepresenting Python's speed.  On the other
    Guido> hand, if you used Python's time.clock(): t1 = time.clock()
    Guido> bench() t2 = time.clock() you're fine.  Without this
    Guido> information your numbers are meaningless (at least to
    Guido> skeptics :-).

Ok, I admit that I also tested with time python bench.py. 
But the result is in this case almost the same. because I repeated the 
test 100 times. That means the test runs almost one minute, startup time
becomes unimportant for such a small test. 

Remeasuring with time gave me the same result. 

By the way the call I used is  tak(18, 12, 6). I forgot to mention that in 
my first post. 

Anyway, what I just want to say is that there is room for improvement and that
it's worth the effort. 
I also measured the function call speed of the language 'ruby' that
R. Beherends mentioned here. It runs the function call speed test
almost at the same speed as python.  

Markus
-- 
Markus Kohler  mailto:markus_kohler at hp.com




More information about the Python-list mailing list