Issue #6713: Improve performance of str(n) and repr(n) for integers n · pythoncapi/cpython@0a1efd0 · GitHub
Skip to content

Commit 0a1efd0

Browse files
committed
Issue python#6713: Improve performance of str(n) and repr(n) for integers n
(up to 3.1 times faster in tests), by special-casing base 10 in _PyLong_Format.
1 parent 3360401 commit 0a1efd0

3 files changed

Lines changed: 122 additions & 0 deletions

File tree

Include/longintrepr.h

Lines changed: 4 additions & 0 deletions

Misc/NEWS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ What's New in Python 3.2 Alpha 1?
1212
Core and Builtins
1313
-----------------
1414

15+
- Issue #6713: Improve performance of integer -> string conversions.
16+
1517
- Issue #6846: Fix bug where bytearray.pop() returns negative integers.
1618

1719
- Issue #6750: A text file opened with io.open() could duplicate its output

Objects/longobject.c

Lines changed: 116 additions & 0 deletions

0 commit comments

Comments
 (0)