A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2012-March/117989.html below:

Integrate the decimal floating point libmpdec library to speed

[Python-Dev] [Python-checkins] cpython: Issue #7652: Integrate the decimal floating point libmpdec library to speedStefan Krah stefan at bytereef.org
Fri Mar 23 11:40:05 CET 2012
Victor Stinner <victor.stinner at gmail.com> wrote:
> By the way, how much faster is cdecimal? 72x or 80x?
> http://docs.python.org/dev/whatsnew/3.3.html#decimal

It really depends on the precision. Also, the performance of decimal.py
depends on many other things in the Python tree, so it easily changes
+-10%. Currently, decimal.py seems to be 10% faster than in 3.2, maybe
because of the new string representation.


The 80x is a ballpark figure for the maximum expected speedup for
standard numerical floating point applications.


factorial(1000) is 219x faster in _decimal, and with increasing
precision the difference gets larger and larger.


For huge numbers _decimal is also faster than int:

factorial(1000000):

_decimal, calculation time: 6.844487905502319
_decimal, tostr():          0.033592939376831055

int, calculation time: 17.96010398864746
int, tostr(): ... still running ...



Stefan Krah


More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4