[Python-Dev] Decimal in C status (was Re: draft 3.1 releaseschedule)

Raymond Hettinger python at rcn.com
Tue Mar 10 14:46:57 CET 2009


[Nick Coghlan]
>> What about decimal-in-C, by the way? Is anyone still working on it?

I'm seeking funding for the project. If it is forthcoming, I intend to do
a pure C version that simply implements the spec and then adds
wrappers for the pure python interface.  That will save the cost
of constantly creating and modifying many pyobjects that currently
arise during intermediate calculations.  

It's possible to focus just of the mantissa calculations but the cost of
the actual arithmetic work is swapped by the overhead of managing
contexts, checking for special values, and memory allocations.
Without addressing those, I think decimal will remain critically
performance challenged compared to native floats (decimals
will never be that fast, but they can get close enough to make
them a viable alternative for many kinds of work).



Raymond


More information about the Python-Dev mailing list