Speed Comparison Perl Python & C

Paul Rubin http
Mon Mar 1 17:03:13 EST 2004


Josiah Carlson <jcarlson at nospam.uci.edu> writes:
> Not quite fair.  The Python version does long-integer
> (infinite-precision) math when i is greater than 65534 on a 32 bit
> processor. 

Why is that unfair?  It's showing a difference between Fortran and
Python, that Fortran supports 64-bit integers, while Python has to
resort to longs.

> Furthermore, you allow fortran to optimize the loop, but you don't
> optimize the python loop yourself, using those portions built-in that
> are known to be fast.

Nothing stops Python from optimizing the loop.  It just doesn't do so.
Again, it's an implementation vs implementation comparison, with
Fortran winning.



More information about the Python-list mailing list