◐ Shell
clean mode source ↗

bpo-46841: Use *inline* caching for `BINARY_OP` by brandtbucher · Pull Request #31543 · python/cpython

Here's a sort-of-rough first pass at implementing this idea. BINARY_OP is easy to start with, since it only uses its cache for the adaptive counter member. Initial perf testing doesn't show any impact, which I think is good (it means that the basic idea works well, even when the cache isn't being used).

Related changes:

  • All of the dis utilities grow a show_caches parameter, defaulting to False.
  • wordcode_helpers.h has been moved into compile.c.

https://bugs.python.org/issue46841