Skip to content

bpo-42115: Add an opcode cache for LOAD_METHOD #23503

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 1 commit into from

Conversation

pablogsal
Copy link
Member

@pablogsal pablogsal commented Nov 24, 2020

@pablogsal pablogsal force-pushed the load_method branch 3 times, most recently from 8403dfd to e34475d Compare November 24, 2020 22:34
@pablogsal pablogsal self-assigned this Dec 14, 2020
@pablogsal pablogsal changed the title bpo-42115: Add an opcode cache for LOAD_ATTR bpo-42115: Add an opcode cache for LOAD_METHOD Dec 14, 2020
@@ -111,7 +111,7 @@ static long dxp[256];
#else
#define OPCACHE_MIN_RUNS 1024 /* create opcache when code executed this time */
#endif
#define OPCODE_CACHE_MAX_TRIES 20
#define OPCACHE_MAX_TRIES 20
Copy link
Member

Choose a reason for hiding this comment

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

Let's maybe add a comment clarifying what this knob does?

@1st1
Copy link
Member

1st1 commented Dec 15, 2020

Add a NEWS update?

Also this looks pretty similar to my original patch but I didn't compare. Were there any changes to it, I'm just curious?

@pablogsal
Copy link
Member Author

pablogsal commented Dec 15, 2020

Also this looks pretty similar to my original patch but I didn't compare. Were there any changes to it, I'm just curious?

The idea is the same but this part is simplified:

https://github.com/python/cpython/pull/23503/files#diff-c22186367cbe20233e843261998dc027ae5f1f8c0d2e778abfa454ae74cc59deR3866-R3875

I am also using _PyDict_GetItem_KnownHash to fetch the items for slightly better performance and the rest is just modifications to account for the code changes around.

I am waiting for Inada-san to confirm the benchmarks before landing and adding the NEWS item

@pablogsal
Copy link
Member Author

I am closing this as the benchmarks are not that exiting after rebasing and benchmarking again :(

@pablogsal pablogsal closed this Dec 16, 2020
gvanrossum added a commit to gvanrossum/cpython that referenced this pull request Jan 31, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants