-
-
Notifications
You must be signed in to change notification settings - Fork 31.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Missing fast path in PyLong_From*() functions for compact integers #129149
Labels
interpreter-core
(Objects, Python, Grammar, and Parser dirs)
performance
Performance or resource usage
type-feature
A feature request or enhancement
Comments
|
This was referenced Jan 22, 2025
vstinner
added a commit
that referenced
this issue
Jan 23, 2025
…rs (#129168) Add fast path in PyLong_From*() functions for compact integers. Co-authored-by: Pieter Eendebak <[email protected]> Co-authored-by: Sergey B Kirpichev <[email protected]> Co-authored-by: Yan Yanchii <[email protected]> Co-authored-by: Bénédikt Tran <[email protected]> Co-authored-by: Victor Stinner <[email protected]>
chris-eibl
added a commit
to chris-eibl/cpython
that referenced
this issue
Jan 25, 2025
Use it in PyLong_FromLong() and PyLong_FromLongLong(). This is just a refactoring and will create the same binary code.
skirpichev
added a commit
to chris-eibl/cpython
that referenced
this issue
Jan 26, 2025
chris-eibl
added a commit
to chris-eibl/cpython
that referenced
this issue
Jan 29, 2025
chris-eibl
added a commit
to chris-eibl/cpython
that referenced
this issue
Mar 1, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
interpreter-core
(Objects, Python, Grammar, and Parser dirs)
performance
Performance or resource usage
type-feature
A feature request or enhancement
Feature or enhancement
Proposal:
See e.g. the fast path using_PyLong_FromMedium() in
PyLong_FromLong()
.PyLong_FromLongLong()
is almost identical.Maybe then implement
PyLong_FromSsize_t()
,PyLong_FromLong()
andPyLong_FromLongLong()
) using a macro similar to PYLONG_FROM_UINT to get rid of the repetitive code?PYLONG_FROM_UINT is missing the fast path for medium values, too.
Has this already been discussed elsewhere?
This is a minor feature, which does not need previous discussion elsewhere
Links to previous discussion of this feature:
Per encouragement from @iritkatriel in #128927 (comment)
Linked PRs
PyLong_FromSsize_t()
#129301The text was updated successfully, but these errors were encountered: