Python from Wise Guy's Viewpoint

Stephen J. Bevan stephen at dino.dnsalias.com
Tue Oct 28 22:31:14 EST 2003


Pascal Costanza <costanza at web.de> writes:
> > is that for many algorithms people want to be sure that the compiler
> > represents their values in machine words.  Infinite precision is
> > needed sometimes, but in the majority of cases it is overkill.  If you
> > need infinite precision, specify the type (IntInf.int in SML's case).
> > A clever compiler might optimize that like a Lisp compiler does.  In
> > most other cases, why take any chances?
> 
> I disagree strongly here. I am convinced that in most algorithms,
> machine words don't matter at all. Have you ever seen in books on
> algorithms that they actually _need_ to restrict them to values that
> are representable in machine word sizes?
> [snip]
> Computers are fast enough and have enough memory nowadays. You are
> talking about micro efficiency. That's not interesting anymore.

Implement something like MD5, SHA-1, AES, ... etc. in your favourite
language and use the fastest compiler available to you to calculate
how many MB/s it can process.  If it can get say with a factor of 2 of
C code then IMHO you'll have proved your point.  If not, then either
your point stands but your favourite language doesn't have
sufficiently good compilers available yet, or exact sizes are required
in order to get good performance in this case.




More information about the Python-list mailing list