Python 2 times slower than Perl
Christopher A. Craig
com-nospam at ccraig.org
Thu Jul 19 21:24:22 EDT 2001
bokr at accessone.com (Bengt Richter) wrote in message news:<3b550e40.2201271731 at wa.news.verio.net>...
> Well rare, but not always dumb, I think. If you're only using a constant
> in one place that happens to be in a loop, and the clearest way to express
> it is as a constant expresssion, you do it that way when you know it's going
> to be folded. E.g., compare (5280.0/60.0*60.0) vs 1.4666667 -- which would
> you feel surer about, reviewing the code, given the same comment saying
> mph->fps?
>
> Of course, with Python it would be dumb not to move it out of the loop, if
> you could save significant execution time.
>
Or worse I frequently need things like (1L<<1024)-1, and though I know my
powers of two quite well, I don't think I'd immediately recognize that one
:-)
More information about the Python-list
mailing list