Skip to content

Use explicit constants in stack effects when known. #116468

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

Closed
markshannon opened this issue Mar 7, 2024 · 1 comment
Closed

Use explicit constants in stack effects when known. #116468

markshannon opened this issue Mar 7, 2024 · 1 comment
Assignees
Labels
3.13 bugs and security fixes interpreter-core (Objects, Python, Grammar, and Parser dirs) performance Performance or resource usage

Comments

@markshannon
Copy link
Member

markshannon commented Mar 7, 2024

We use oparg for stack effects even when oparg is a constant for a particular specialization.
For example UNPACK_SEQUENCE_TUPLE is defined as:

inst(UNPACK_SEQUENCE_TWO_TUPLE, (unused/1, seq -- values[oparg]))

resulting in slightly inefficient code. It should be defined as:

inst(UNPACK_SEQUENCE_TWO_TUPLE, (unused/1, seq -- val1, val0))

Linked PRs

@markshannon markshannon added performance Performance or resource usage interpreter-core (Objects, Python, Grammar, and Parser dirs) 3.13 bugs and security fixes labels Mar 7, 2024
@markshannon markshannon self-assigned this Mar 7, 2024
markshannon added a commit that referenced this issue Mar 11, 2024
@hugovk
Copy link
Member

hugovk commented Mar 15, 2024

Triage: can this issue be closed?

adorilson pushed a commit to adorilson/cpython that referenced this issue Mar 25, 2024
diegorusso pushed a commit to diegorusso/cpython that referenced this issue Apr 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.13 bugs and security fixes interpreter-core (Objects, Python, Grammar, and Parser dirs) performance Performance or resource usage
Projects
None yet
Development

No branches or pull requests

2 participants