bpo-42115: Add an opcode cache for LOAD_METHOD by pablogsal · Pull Request #23503 · python/cpython
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:
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