]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-97912: Avoid quadratic behavior when adding LOAD_FAST_CHECK (GH-97952)
authorDennis Sweeney <36520290+sweeneyde@users.noreply.github.com>
Thu, 20 Oct 2022 22:27:41 +0000 (18:27 -0400)
committerGitHub <noreply@github.com>
Thu, 20 Oct 2022 22:27:41 +0000 (18:27 -0400)
commit39bc70e267929600057d62103739b7160e69dc8b
treefa4bd575ea2c39ddcf759af111747bd4f48d9924
parent6f15ca8c7afa23e1adc87f2b66b958b721f9acab
gh-97912: Avoid quadratic behavior when adding LOAD_FAST_CHECK (GH-97952)

* The compiler analyzes the usage of the first 64 local variables all at once using bit masks.

* Local variables beyond the first 64 are only partially analyzed, achieving linear time.
Lib/test/test_peepholer.py
Misc/NEWS.d/next/Core and Builtins/2022-10-06-06-36-29.gh-issue-97912.jGRJpa.rst [new file with mode: 0644]
Python/compile.c