How Fast Does Python Run?

Aleksey Kishkin ax at infocentr.ru
Fri Jun 16 16:41:16 EDT 2000


"John W. Baxter" wrote:
> 
> 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.
> 
 Well. I dont think either that my test was really exact estimation.
And it was just "5-minutes work" for fun after a workday..
I used translators "as is", I hadn't change any settings, 
and, speaking frankly, I wanted to know how fast was java, 
not python..
But if you want to know versions of translators, 

tcl/tk 8.0
perl 5.005
python 1.52
C - gcc 2.95, without optim. just " gcc sieve.c ",
   with optimization "gcc -O2 sieve.c "
Java without JIT -JDK 1.1.7 from blackdown.org 
and with JIT - kaffe (I can't remember version, it was from 
  distribution of linux mandrake 7)
pascal - fpc

Computer Pentium 233MMX 80 Mb Ram linux, mandrake 7

Sorry again, I don't think that it was strong enough test, but
I thought it might be interesting....









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



More information about the Python-list mailing list