How Fast Does Python Run?

John W. Baxter jwbnews at scandaroon.com
Fri Jun 16 16:27:51 EDT 2000


In article <394A7763.DE2A771D at infocentr.ru>, Aleksey Kishkin 
<ax at infocentr.ru> wrote:

> Akira Kiyomiya wrote:
> > 
> > I wonder if Python runs faster than Perl.
> > 
> > Could someone give me some comparison and contrast with some languages 
> > such
> > as Perl, Tcl, JavaScript, etc?
> > 
> > I am just curious.
> > 
> > Thanks
> > 
> > Akria
> 
> I did. I found the programm (sieve) for java and rewrote this
> programm to all languages which I had at that moment.
> It worked 10 seconds and printed how much this task was solved.
> 
> (it means bigger amount is better)
> 
> TCL  - 13 times / 10 sec 
> perl - 64
> python - 36
> C without optimization - 6468
> C with optimization  - 19111
> Java without JIT (1.1.7) - 921
> Java with JIT (kaffe)  - 8230
> pascal (fpc)   - 4451
>  
> Well. that's all

Having encountered the infamous sieve years ago in an article in "Byte" 
which made Pascal on 6502 (1 mhz) look slower than Pascal on Z80 (2 
mhz), when in fact the reverse was true, I discount all such claims 
unless I see (and understand) the code.

Part of the problem in the Byte code was that runtime checking was on by 
default in the compiler on 6502, and off by default in the compiler for 
the Z80.  There were other issues as well.  (You also don't indicate 
what compilers are used for any of the above (unless fpc specifies a 
particular Pascal).

All that is separate from the fact that the sieve isn't real-world code 
(aside from classes and benchmarks, how often is it actually used)?  But 
if properly written, it is indicative.

  --John

-- 
John W. Baxter   Port Ludlow, WA USA  jwbnews at scandaroon.com



More information about the Python-list mailing list