Python 2 times slower than Perl

Johann Hibschman johann at physics.berkeley.edu
Wed Jul 18 19:05:58 EDT 2001


Roman Suzi writes:

> On Wed, 18 Jul 2001, John J. Lee wrote:
>> On 18 Jul 2001, Johann Hibschman wrote:
>> [...]
>>> cc -O2       0.28
>>> cc           0.62
>>> ocamlopt     1.26   (compiled)
>>> ocaml        9.42   (interpreted)
>>> perl        28.9
>>> python      66.8

After re-compiling python with -O2, my result is:

python     31.4

which I find much more believable.  That optimization really helps!
Perhaps the python configuration process should default to compiling
with -O2 rather than with -O?

> But in my applications speed is not the main virtue. The top thing is
> express logic in a plain language and this is Python great at.

I have a good bit of leisure time these days (i.e. I'm only barely
employed), so I've been playing around with ocaml.  It's nice,
although it took me a while to get up to really understand the
language.  I like it, quite a bit, but then again I do numerics, so
speed is always a blessing.

If you have some time, take a look at ocaml.  It'll teach you
something.  I don't know if you'll find it useful, but it's
educational.

> That is why I do not understand why Java is so popular:  it is not large
> enough improvement over C/C++ in terms of source readability but still
> poses serious overhead in execution speed... I have the feeling it stalled
> at the middle between C++ and Python...

I agree with you here, completely.  But it is nice to have GC...

> _/ Russia _/ Karelia _/ Petrozavodsk _/ rnd at onego.ru _/

Heh.  My mother was born in Karelia, before she had to move rather
rapidly to Finland around 1940.  I still would like to visit the area
one of these days.  All right, so I'm rambling now.

-- 
Johann Hibschman                           johann at physics.berkeley.edu



More information about the Python-list mailing list