Skip to content

bpo-37271: Optimize bytecode multiple times until it cannot be optimized further #14068

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
wants to merge 6 commits into from

Conversation

pablogsal
Copy link
Member

@pablogsal pablogsal commented Jun 14, 2019

@nedbat
Copy link
Member

nedbat commented Jun 14, 2019

@pablogsal Any chance you want to help get #13600 finished?

@pablogsal
Copy link
Member Author

@nedbat Sure, I will talk with Victor to see if we can push it forward.

@pablogsal pablogsal changed the title Optimize bytecode multiple times until it cannot be optimized further bpo-37271: Optimize bytecode multiple times until it cannot be optimized further Jun 14, 2019
@pablogsal pablogsal marked this pull request as ready for review June 14, 2019 02:00
@pablogsal pablogsal force-pushed the multiple_bytecode_opt branch 2 times, most recently from 576034a to f9b5588 Compare June 14, 2019 02:04
@pablogsal pablogsal self-assigned this Jun 14, 2019
@pablogsal pablogsal force-pushed the multiple_bytecode_opt branch 2 times, most recently from 64fa0b9 to 8188a1a Compare June 14, 2019 03:15
@pablogsal
Copy link
Member Author

@serhiy-storchaka What do you think about this approach?

@brettcannon brettcannon added the performance Performance or resource usage label Jun 21, 2019
@pablogsal pablogsal force-pushed the multiple_bytecode_opt branch from 8188a1a to 282da9e Compare July 13, 2019 15:06
@pablogsal pablogsal force-pushed the multiple_bytecode_opt branch from 9119526 to 68a2657 Compare July 29, 2019 11:15
@pablogsal
Copy link
Member Author

I have rebased and address the feedback. Also, I have added a max cap of iterations (although is not needed, it can be proven that the while loop will always finish) to make sure the time expended in the loop is always bounded.

@pablogsal pablogsal force-pushed the multiple_bytecode_opt branch 2 times, most recently from d9f5d4a to 99bb01a Compare July 29, 2019 11:17
@pablogsal pablogsal requested a review from tim-one July 29, 2019 11:17
@pablogsal pablogsal force-pushed the multiple_bytecode_opt branch 2 times, most recently from 7aed1c2 to a5ec1be Compare July 29, 2019 14:19
Copy link
Member

@markshannon markshannon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good in general, just a couple of questions.

@pablogsal pablogsal force-pushed the multiple_bytecode_opt branch from cc7a51f to cba4927 Compare September 9, 2019 14:49
@pablogsal
Copy link
Member Author

@markshannon I have added some comments as requested, check if they look good to you :)

@pablogsal pablogsal force-pushed the multiple_bytecode_opt branch from 4c853b8 to 22560ac Compare September 9, 2019 15:42
@pablogsal
Copy link
Member Author

CC: @Yhg1s

@pablogsal
Copy link
Member Author

This is the code that is failing the assert currently:

def f(cond1, cond2):
    while 1:
        return 3
    while 1:
        return 5
    return 6

@Yhg1s
Copy link
Member

Yhg1s commented Sep 11, 2019

GH-15970 should fix the lnotab issue.

@pablogsal pablogsal closed this Nov 16, 2020
@pablogsal pablogsal deleted the multiple_bytecode_opt branch May 19, 2021 18:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting core review performance Performance or resource usage
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants