[New-bugs-announce] [issue45569] Drop support for 15-bit PyLong digits?

Mark Dickinson report at bugs.python.org
Fri Oct 22 06:21:47 EDT 2021


New submission from Mark Dickinson <dickinsm at gmail.com>:

Looking at issue #35037 (which is a compatibility issue having to do with PYLONG_BITS_IN_DIGIT), I'm wondering whether it would make sense to drop support for 15-bit PyLong digits altogether. This would simplify some of the code, eliminate a configuration option, and eliminate the scope for ABI mismatches like that occurring in #35037.

There were a couple of reasons that we kept support for 15-bit digits when 30-bit digits were introduced, back in #4258.

- At the time, we wanted to use `long long` for the `twodigits` type with 30-bit digits, and we couldn't guarantee that all platforms we cared about would have `long long` or another 64-bit integer type available.

- It wasn't clear whether there were systems where using 30-bit digits in place of 15-bit digits might cause a performance regression.

Now that we can safely rely on C99 support on all platforms we care about, the existence of a 64-bit integer type isn't an issue (and indeed, we already rely on the existence of such a type in dtoa.c and elsewhere in the codebase).

As to performance, I doubt that there are still platforms where using 15-bit digits gives a performance advantage, but I admit I haven't checked.

----------
messages: 404746
nosy: mark.dickinson
priority: normal
severity: normal
status: open
title: Drop support for 15-bit PyLong digits?

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45569>
_______________________________________


More information about the New-bugs-announce mailing list