DecompressedStream: improve performance
authorHelmut Grohne <helmut@subdivi.de>
Thu, 30 Dec 2021 16:52:38 +0000 (17:52 +0100)
committerHelmut Grohne <helmut@subdivi.de>
Thu, 30 Dec 2021 16:52:38 +0000 (17:52 +0100)
commit0b4882ecf657d70dd3236dcf176e083bf08dccdd
treec688aa1964a111c75f7035fa243df16030ba3ba1
parent35c22db308a91e82ed4a5f6a9c937c186d81d810
DecompressedStream: improve performance

When the decompression ratio is huge, we may be faced with a large
(multiple megabytes) bytes object. Slicing that object incurs a copy
becomes O(n^2) while appending and trimming a bytearray is much faster.
dedup/compression.py