diff options
author | Thomas Krennwallner <tk+github@postsubmeta.net> | 2020-04-19 15:19:24 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-19 15:19:24 (GMT) |
commit | c8f1715283ec51822fb37a702bf253cbac1af276 (patch) | |
tree | 60af91a48d204d4f0ebe5947498a3dbd9fd15b24 /Misc/NEWS.d | |
parent | 1ac6e379297cc1cf8acf6c1b011fccc7b3da2cbe (diff) | |
download | cpython-c8f1715283ec51822fb37a702bf253cbac1af276.zip cpython-c8f1715283ec51822fb37a702bf253cbac1af276.tar.gz cpython-c8f1715283ec51822fb37a702bf253cbac1af276.tar.bz2 |
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>
Diffstat (limited to 'Misc/NEWS.d')
-rw-r--r-- | Misc/NEWS.d/next/Library/2020-03-15-08-06-05.bpo-38891.56Yokh.rst | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Misc/NEWS.d/next/Library/2020-03-15-08-06-05.bpo-38891.56Yokh.rst b/Misc/NEWS.d/next/Library/2020-03-15-08-06-05.bpo-38891.56Yokh.rst new file mode 100644 index 0000000..fdb8a05 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2020-03-15-08-06-05.bpo-38891.56Yokh.rst @@ -0,0 +1,3 @@ +Fix linear runtime behaviour of the `__getitem__` and `__setitem__` methods in +:class:`multiprocessing.shared_memory.ShareableList`. This avoids quadratic +performance when iterating a `ShareableList`. Patch by Thomas Krennwallner. |