-
-
Notifications
You must be signed in to change notification settings - Fork 31k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # 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 <pieter.eendebak@gmail.com> Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com> Co-authored-by: Yan Yanchii <yyanchiy@gmail.com> Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com> Co-authored-by: Victor Stinner <vstinner@python.org>
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
# for free
to join this conversation on GitHub.
Already have an account?
# 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: