]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-115727: Reduce confidence even on 100% predicted jumps (#115748)
authorGuido van Rossum <guido@python.org>
Thu, 22 Feb 2024 20:23:48 +0000 (12:23 -0800)
committerGitHub <noreply@github.com>
Thu, 22 Feb 2024 20:23:48 +0000 (12:23 -0800)
commit4ee6bdfbaa792a3aa93c65c2022a89bd2d1e0894
tree7ad7e56f85ec15887338b86e292670fd60abc9db
parent1002fbe12e0bd8c9a54bc5addbf5d94a5b35f91f
gh-115727: Reduce confidence even on 100% predicted jumps (#115748)

The theory is that even if we saw a jump go in the same direction the
last 16 times we got there, we shouldn't be overly confident that it's
still going to go the same way in the future. This PR makes it so that
in the extreme cases, the confidence is multiplied by 0.9 instead of
remaining unchanged. For unpredictable jumps, there is no difference
(still 0.5). For somewhat predictable jumps, we interpolate.
Python/optimizer.c