Is python very slow compared to C

Felipe Almeida Lessa felipe.lessa at gmail.com
Sun Feb 12 06:55:33 EST 2006


Em Dom, 2006-02-12 às 03:03 -0800, bearophileHUGS at lycos.com escreveu:
> Probably every answer I can give you is wrong for you, so answering is
> almost useless... In this thread we have already given the most
> pertinent answers to the original question from Diffuse.
> I can show you this page, but I think this is useless too for you:
> http://shootout.alioth.debian.org/gp4/benchmark.php?test=all〈=python&lang2=ocaml

What they were saying is that at most of the times your program is going
to sit and wait for things like network, hard drive, user input, etc.,
and these cannot be changed by any language. Those benchmarks test only
raw CPU performance.

Yes, sometimes you *need* raw CPU power, but nobody said that in this
case Python is good for you. Python is good at making your life as a
programmer easier, and every Python programmer knows that.

I wanted to see PyRex or C modules versions of that benchmarks, it would
be really nice. This is the approach used to create fast CPU-bound
algorithms in Python, and as such should be tested as thoroughly as
those Python-only counterparts.

And if it matters for you: Google says Python is fast for them, what
else do you want?

Cya,
Felipe. 

-- 
"Quem excele em empregar a força militar subjulga os exércitos dos
outros povos sem travar batalha, toma cidades fortificadas dos outros
povos sem as atacar e destrói os estados dos outros povos sem lutas
prolongadas. Deve lutar sob o Céu com o propósito primordial da
'preservação'. Desse modo suas armas não se embotarão, e os ganhos
poderão ser preservados. Essa é a estratégia para planejar ofensivas."

  -- Sun Tzu, em "A arte da guerra"




More information about the Python-list mailing list