]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-94155: Reduce hash collisions for code objects (#100183)
authorDennis Sweeney <36520290+sweeneyde@users.noreply.github.com>
Fri, 23 Dec 2022 18:15:47 +0000 (13:15 -0500)
committerGitHub <noreply@github.com>
Fri, 23 Dec 2022 18:15:47 +0000 (13:15 -0500)
commita98d9ea56e7b473af54438ecc487a6bf1b4d6530
tree792d718b70d08874bd011cbf800af000abdca7e9
parent36d358348de8efad75ebcf55dad8ed4a4f6dcda9
gh-94155: Reduce hash collisions for code objects (#100183)

* Uses a better hashing algorithm to get better dispersion and remove commutativity.

* Incorporates `co_firstlineno`, `Py_SIZE(co)`, and bytecode instructions.

* This is now the entire set of criteria used in `code_richcompare`, except for `_PyCode_ConstantKey` (which would incorporate the types of `co_consts` rather than just their values).
Lib/test/test_code.py
Misc/NEWS.d/next/Core and Builtins/2022-12-12-00-59-11.gh-issue-94155.LWE9y_.rst [new file with mode: 0644]
Objects/codeobject.c