Python slow for filter scripts

Peter Maas fpetermaas at netscape.net
Wed Nov 5 04:44:00 EST 2003


Peter Mutsaers schrieb:
> I found that on my (linux) PC, the Python version was 4 times slower.
> 
> Is that normal, does it disqualify Python for simple filter scripts?

Have a look at the win32 language shootout (http://dada.perl.it/shootout/)
with lots of benchmarks for lots of languages, among them python,
cygperl (perl with cygwin calls, I assume) and perl (perl with native
win32 calls). cygwin is usually faster than python, perl slower. You
can also look at Doug Bagley's Linux based shootout but it's older
(Perl 5.6, Python 2.1) and currently not maintained.

My impression is that on an average perl is faster than python
but not by an order of magnitude but by ~ 20%.

Your test is probably closest to the "reverse file" benchmark
where cygperl : python : perl = 0.68 : 1.68 : 12.72 on win32
and perl : python = 1.06 : 1.17 on Linux.

Mit freundlichen Gruessen,

Peter Maas

-- 
-------------------------------------------------------------------
Peter Maas, M+R Infosysteme, D-52070 Aachen, Hubert-Wienen-Str. 24
Tel +49-241-93878-0 Fax +49-241-93878-20 eMail peter.maas at mplusr.de
-------------------------------------------------------------------





More information about the Python-list mailing list