Skip to content

Commit

Permalink
Keep section for small integers
Browse files Browse the repository at this point in the history
  • Loading branch information
vstinner committed Sep 18, 2024
1 parent ed629c2 commit 368aea8
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions peps/pep-0757.rst
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,21 @@ API::
Discard the internal object and destroy the writer instance.


Optimize import for small integers
==================================

Proposed import API is efficient for large integers. Compared to
accessing directly Python internals, the proposed import API can have a
significant performance overhead on small integers.

For small integers of a few digits (for example, 1 or 2 digits), existing APIs
can be used:

* :external+py3.14:c:func:`PyLong_FromUInt64()`;
* :c:func:`PyLong_FromLong()`;
* :c:func:`PyLong_FromNativeBytes()`.


Implementation
==============

Expand Down

0 comments on commit 368aea8

Please sign in to comment.