why is python slow?

Fernando Pereira pereira at cis.upenn.edu
Thu Mar 7 21:59:45 EST 2002


On 3/7/02 9:41 PM, in article
a2972632.0203071841.7cd09181 at posting.google.com, "les ander"
<les_ander at yahoo.com> wrote:
> i am just curious as to why different programming languages have different
> speed. I understand that if a language has an extensive grammar
> (such as c++) the compiler would take longer. But what about execution?
You will not get a good answer to this from a newsgroup. No one can
summarize for you what takes years of education and experience in
programming language and implementation to learn. The only way to become
informed on these questions is to study programming languages seriously.
> why is a perl program faster than similar python program?
Says who? What programs? What's a "similar" program? To discuss these
questions scientifically rather than with sound bites, one needs to define
carefully the questions being asked, the experiments that will answer those
questions, the experimental conditions (implementations, hardware
platforms), and the supporting statistical analysis. Benchmarking is a
difficult experimental craft. Relative speeds depend on problem,
experimental conditions, etc. That's why so much effort and discussion went
into developing processor benchmarks like SPECint and SPECfp. And Even then
there are many disagreements on how to interpret them.
>For example
> when java came out it use to be pretty slow, but now it is pretty fast. How
> was this speed-up acheived and why is it not possible to have such a speed up
> for python?
Again, the answers to these questions, and whether the questions themselves
make any sense, require detailed study of many topics in language
implementation. No one can give you a newsgroup-posting-sized answer. If
they do, you shouldn't trust them.

Benchmarking-is-harder-than-/.-ing-ly yours

-- F




More information about the Python-list mailing list