P vs P speed (was RE: Newbie question: files..)
Hrvoje Niksic
hniksic at srce.hr
Tue Oct 12 14:07:45 EDT 1999
"Tim Peters" <tim_one at email.msn.com> writes:
> Python's long ints; Perl's Math::BigInt. I first saw Python when
> working for a company trying to design a 64-bit supercomputer, using
> software on 32-bit workstations. I had been using Perl, very
> painfully and slowly, and the very first Python alpha already ran
> circles around Perl (I'm talking factors of 10 - 100 here) for these
> tasks. I kept Perl for text-crunching, but dropped it for
> everything else.
[...]
> More, this is *typical* in my experience. All the convolution in
> Perl's internals costs time to execute, and Python's much cleaner
> implementation translates to faster runtime. Python gets a bad rap
> here because of one thing: Guido doesn't put "extraordinary effort"
> into optimizing *anything* (it's a personality flaw <wink>), while
> Larry et alia did put extraordinary effort into optimizing some
> common things (mostly related to text-crunching). Outside of its
> areas of special competence, Perl is not fast.
I don't really care about the speed where it doesn't matter. I guess
my problem was that the only usage where speed really did make a
difference was about text-crunching, because textual input files tend
to get large (e.g. large log files, or Debian package files, or
whatever.)
> On my home platform (P5-166, 32Mb RAM, Win95), it takes about 20
> seconds in Perl and about 14 in Python. Which, applying the usual
> benchmarking chicanery, means "Python is 43% faster than Perl".
FWIW, here it takes 16.5 seconds of CPU time, while Perl takes 12.8.
Does that make Perl 37% faster? :-)
Benchmarks truly suck.
More information about the Python-list
mailing list