Python 2 times slower than Perl
Christopher A. Craig
com-nospam at ccraig.org
Tue Jul 17 23:10:07 CEST 2001
-----BEGIN PGP SIGNED MESSAGE-----
Mark Day <mday at apple.com> writes:
> and not the multiplication. I don't think Python will evaluate the
> expression at "compile" time, nor move the assignment outside the loop.
I can't speak for Perl, but Python definately does not evaluate the
expression at compile time. This is a problem I've had with Python.
I wish that when given the -O option the compiler would do constant
That said I created a Perl program that does $j *= 2.5 instead and it
still beat Python handsomely (on a Ultra 10). I expect this is
because of the cost of dealing with so many Python object
creations/deletions which I've found can be quite a bit higher that C
Christopher A. Craig <com-nospam at ccraig.org>
"Sir, your remarks are repugnant to me, and I disagree with your viewpoints.
But I will defend to the death your right to express them." Voltaire
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: Processed by Mailcrypt
-----END PGP SIGNATURE-----
More information about the Python-list