KEMBAR78
[mypyc] Make multiple assignment faster(1st stage) by TH3CHARLie · Pull Request #9575 · python/mypy · GitHub
Skip to content

Conversation

TH3CHARLie
Copy link
Collaborator

@TH3CHARLie TH3CHARLie commented Oct 10, 2020

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
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
Collaborator Author

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

Copy link
Collaborator

@JukkaL JukkaL left a comment

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