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

bpo-33325: Optimize sequences of constants in the compiler #6559

Closed

Conversation

serhiy-storchaka
Copy link
Member

@serhiy-storchaka serhiy-storchaka commented Apr 21, 2018

  • Replace LOAD_CONST c1, LOAD_CONST c2, ... LOAD_CONST cn, BUILD_LIST n
    with LOAD_CONST (c1, c2, ... cn), BUILD_LIST_UNPACK 1.

  • Replace LOAD_CONST c1, LOAD_CONST c2, ... LOAD_CONST cn, BUILD_SET n
    with LOAD_CONST frozenset({c1, c2, ... cn}), BUILD_SET_UNPACK 1.

  • Replace LOAD_CONST c1, LOAD_CONST c2, ... LOAD_CONST cn
    with LOAD_CONST (c1, c2, ... cn), UNPACK_SEQUENCE n.

  • Remove unused constants.

https://bugs.python.org/issue33325

@serhiy-storchaka
Copy link
Member Author

Closed because in practice the benefit is very small and not stable.

@serhiy-storchaka serhiy-storchaka deleted the compiler-consts branch November 20, 2018 18:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants