Skip to content

bpo-26110: Document CALL_METHOD_KW #26159

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

Merged
merged 6 commits into from
May 19, 2021

Conversation

Fidget-Spinner
Copy link
Member

@Fidget-Spinner Fidget-Spinner commented May 16, 2021

  • Added CALL_METHOD_KW to whatsnew in 3.11 and dis docs.
  • Fixed 1 minor nit in the 3.11 whatsnew too.

https://bugs.python.org/issue26110

@Fidget-Spinner
Copy link
Member Author

@pablogsal Can I trouble you for a review too please? Thanks!

@pablogsal
Copy link
Member

@pablogsal Can I trouble you for a review too please? Thanks!

Anytime ;)

changes which avoid creating bound method instances. Previously, this
optimization was applied only to method calls with purely positional
arguments.
(Contributed by Ken Jin and Mark Shannon in :issue:`26110`, based on ideas
Copy link
Member

Choose a reason for hiding this comment

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

Is the issue correct? In https://bugs.python.org/issue26110 I don't see any PR for this

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, it didn't appear for some reason, there was some recent discussion about other issues having the same problem https://mail.python.org/archives/list/python-committers@python.org/thread/M2Z3WSJ4SGGH2GQ7D5NELAZSD3PECG7Q/ .

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
@@ -99,6 +99,17 @@ Optimizations
almost eliminated when no exception is raised.
(Contributed by Mark Shannon in :issue:`40222`.)

* Method calls with keywords are now up to 20% faster due to bytecode
Copy link
Member

Choose a reason for hiding this comment

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

Do we have a pyperformance run for this? I only found your comment here:

#26014 (comment)

but I don't see the full run with LTO/PGO. This is important as normally we report 20% faster based on the pyperformance run, not for individual microbenchs.

Copy link
Member Author

Choose a reason for hiding this comment

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

I ran pyperformance with LTO+PGO and saw no change because pyperformance code barely uses method calls with keywords. That entry is taken from the whats new in python 3.7 https://docs.python.org/3/whatsnew/3.7.html#optimizations and is also the result of a microbench. Maybe I should just remove that line :(?

Recently I've been thinking that pyperformance doesn't really have enough object-oriented benchmarks. Maybe I can look into adding some.

Copy link
Member

Choose a reason for hiding this comment

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

Maybe take a look at the pyston benchmarks? https://github.com/pyston/python-macrobenchmarks

Copy link
Member

Choose a reason for hiding this comment

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

That entry is taken from the whats new in python 3.7 https://docs.python.org/3/whatsnew/3.7.html#optimizations and is also the result of a microbench.

Maybe I am missing something, but we did a pyperformance run for that:

https://bugs.python.org/msg282622

Maybe I should just remove that line :(?

No, but surely clarify that a bit better: mention that is on a microbenchmark.

Recently I've been thinking that pyperformance doesn't really have enough object-oriented benchmarks. Maybe I can look into adding some.

That's a good idea. Meke sure to sync also with @vstinner

Copy link
Member Author

Choose a reason for hiding this comment

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

That entry is taken from the whats new in python 3.7 https://docs.python.org/3/whatsnew/3.7.html#optimizations and is also the result of a microbench.

Maybe I am missing something, but we did a pyperformance run for that:

https://bugs.python.org/msg282622

Gah, I just realised my message to you was misworded. What I meant was "That entry is taken from the whats new in python 3.7 https://docs.python.org/3/whatsnew/3.7.html#optimizations and the number I provided is the result of a microbench.". Sorry.

@pablogsal
Copy link
Member

Thanks @Fidget-Spinner !

@pablogsal pablogsal merged commit 5c66195 into python:main May 19, 2021
@Fidget-Spinner
Copy link
Member Author

@pablogsal thanks for the reviews and merge :).

@Fidget-Spinner Fidget-Spinner deleted the whatsnew_call_method_kw branch May 20, 2021 13:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation in the Doc dir skip news
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants