Python behind the scenes #8: how Python integers work
tenthousandmeters.com
tenthousandmeters.com
* How CPython represents arbitrary-precision integers.
* How CPython implements arbitrary-precision arithmetic, such as addition and multiplication.
* How CPython's implementation of arbitrary-precision arithmetic compares to other implementations.
I welcome your feedback and questions. Thanks!I think the only reason not to have that is maintaining c-python compatibility, but it would have been nice if they could have moved to it for the 3.0 break.
https://mail.python.org/pipermail/python-dev/2004-July/04614...
Sure, but the only opportunity to change this was along with the other breaking changes in Python 3.0, which is now 12 years old.
"How fast is CPython's implementation of bignums compared to other implementations? ... One important thing to know about these results is that the fastest programs use bignums provided by the GMP library and not the bignums provided by the language. If we exclude the programs that use GMP bindings, we get the following results... "
If we don't want the programs that used the GMP library, then we can simply not show those results!
Except "Some languages rely on GMP to implement built-in bignums. They are marked with an asterisk (*)." — why are they shown?
(And why isn't there a C program + GMP measurement?)
I'm not the first one who draw such a comparison. This article goes into some more detail: http://www.wilfred.me.uk/blog/2014/10/20/the-fastest-bigint-...