long(Decimal) performance

Aahz aahz at pythoncraft.com
Sat Aug 12 09:56:36 EDT 2006


In article <1155349097.946873.279970 at b28g2000cwb.googlegroups.com>,
ajaksu <ajaksu at gmail.com> wrote:
>
>Running long(Decimal) is pretty slow, and the conversion is based on
>strings. I'm trying to figure out whether there is a good reason for
>using strings like in decimal.py (that reason would be bound to bite me
>down the road).

I'm not sure why it's coded that, but it's somewhat irrelevant: right
now, work is being done to convert decimal.py to C code, which will
almost certainly be much faster than your code.  Generally speaking, you
should not be using Decimal now with any expectation of speed.
-- 
Aahz (aahz at pythoncraft.com)           <*>         http://www.pythoncraft.com/

"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are, by
definition, not smart enough to debug it."  --Brian W. Kernighan



More information about the Python-list mailing list