]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
bpo-38891: avoid quadratic item access performance of ShareableList (GH-18996)
authorThomas Krennwallner <tk+github@postsubmeta.net>
Sun, 19 Apr 2020 15:19:24 +0000 (11:19 -0400)
committerGitHub <noreply@github.com>
Sun, 19 Apr 2020 15:19:24 +0000 (17:19 +0200)
commitc8f1715283ec51822fb37a702bf253cbac1af276
tree60af91a48d204d4f0ebe5947498a3dbd9fd15b24
parent1ac6e379297cc1cf8acf6c1b011fccc7b3da2cbe
bpo-38891: avoid quadratic item access performance of ShareableList (GH-18996)

Avoid linear runtime of ShareableList.__getitem__ and
ShareableList.__setitem__ by storing running allocated bytes in
ShareableList._allocated_bytes instead of the number of bytes for
a particular stored item.

Co-authored-by: Antoine Pitrou <antoine@python.org>
Lib/multiprocessing/shared_memory.py
Misc/NEWS.d/next/Library/2020-03-15-08-06-05.bpo-38891.56Yokh.rst [new file with mode: 0644]