Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[mypyc] Make multiple assignment faster(1st stage) - #9575

Merged
JukkaL merged 1 commit into
python:masterfrom
TH3CHARLie:multiple-assignment-mypyc
Oct 14, 2020
Merged

[mypyc] Make multiple assignment faster(1st stage)#9575
JukkaL merged 1 commit into
python:masterfrom
TH3CHARLie:multiple-assignment-mypyc

Conversation

@TH3CHARLie

@TH3CHARLie TH3CHARLie commented Oct 10, 2020

Copy link
Copy Markdown
Collaborator

relates mypyc/mypyc#729

This PR makes simple cases like y, x = x, y faster.

I tend to do some future improvement based on this PR(for example, supporting ListExpr as @JukkaL suggested), nevertheless, this PR itself should cover the most frequent use case.

@TH3CHARLie

Copy link
Copy Markdown
Collaborator Author

Some imprecise benchmark results:

Before:

............
interpreted: 0.167262s (avg of 6 iterations; stdev 0.61%)
compiled:    0.163983s (avg of 6 iterations; stdev 0.48%)

compiled is 1.020x faster

After:

running multiple_assignment
............
interpreted: 0.164994s (avg of 6 iterations; stdev 0.52%)
compiled:    0.055589s (avg of 6 iterations; stdev 0.69%)

compiled is 2.968x faster

@TH3CHARLie
TH3CHARLie requested a review from JukkaL October 10, 2020 23:29
@TH3CHARLie

Copy link
Copy Markdown
Collaborator Author

I believe the failed StubgenCliParseSuite.test_walk_packages is not related to this PR

@JukkaL JukkaL left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks great! This fixes a bad performance bottleneck.

@JukkaL
JukkaL merged commit e2274a6 into python:master Oct 14, 2020
@TH3CHARLie
TH3CHARLie deleted the multiple-assignment-mypyc branch October 14, 2020 11:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants