X Tutup
The Wayback Machine - https://web.archive.org/web/20230227233018/https://github.com/python/cpython/issues/101291
Skip to content
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

Restore (or beat) Python 2 performance for arithmetic operations on ints that fit into a single word #101291

Open
markshannon opened this issue Jan 24, 2023 · 0 comments
Labels
performance Performance or resource usage

Comments

@markshannon
Copy link
Member

markshannon commented Jan 24, 2023

In Python 2 ints and longs were different objects, and the design of each was tailored to the different size and use cases.
In Python3 we dropped the distinction, but we also dropped the design for ints that fit into a single word.
We have added various fast paths for "medium" integers (e.g. #89109) but the underlying data structure gets in the way.

We should layout the int/long object so that it supports fast operations for most integers.

See faster-cpython/ideas#548 for a fuller discussion

Linked PRs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance Performance or resource usage
Projects
None yet
Development

No branches or pull requests

1 participant
X Tutup