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-37231: optimize calls of special methods #13973

Merged
merged 2 commits into from
Jun 13, 2019
Merged

Conversation

jdemeyer
Copy link
Contributor

@jdemeyer jdemeyer commented Jun 11, 2019

@mangrisano
Copy link
Contributor

/cc @vstinner @methane

Copy link
Member

@methane methane left a comment

Choose a reason for hiding this comment

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

LGTM. Have you run some microbench?
If there is measurable speedup, please write it in NEWS entry.

@jdemeyer
Copy link
Contributor Author

LGTM. Have you run some microbench?

Yes. With this code

class X:
    def __mul__(self, other):
        pass

x = X()

and benchmarking x * x I get a speedup from

Mean +- std dev: 103 ns +- 1 ns

to

Mean +- std dev: 98.6 ns +- 2.2 ns

If there is measurable speedup, please write it in NEWS entry.

Done.

@jdemeyer
Copy link
Contributor Author

I'm thinking that this vectorcall_method is useful enough to become official API. But that will be for a different PR.

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.

5 participants