File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -362,6 +362,9 @@ The following performance enhancements have been added:
362362 The speed up can range from 3x to 15x.
363363 (:issue: `21486 `, :issue: `21487 `, :issue: `20826 `)
364364
365+ * Many operations on :class: `io.BytesIO ` are now 50% to 100% faster.
366+ (Contributed by Serhiy Storchaka in :issue: `15381 `.)
367+
365368
366369Build and C API Changes
367370=======================
Original file line number Diff line number Diff line change @@ -718,12 +718,11 @@ def test_setstate(self):
718718
719719 @support .cpython_only
720720 def test_sizeof (self ):
721- basesize = support .calcobjsize ('P2nN2PnP ' )
721+ basesize = support .calcobjsize ('P2n2Pn ' )
722722 check = self .check_sizeof
723723 self .assertEqual (object .__sizeof__ (io .BytesIO ()), basesize )
724724 check (io .BytesIO (), basesize )
725- check (io .BytesIO (b'a' ), basesize + 1 )
726- check (io .BytesIO (b'a' * 1000 ), basesize + 1000 )
725+ check (io .BytesIO (b'a' * 1000 ), basesize + sys .getsizeof (b'a' * 1000 ))
727726
728727 # Various tests of copy-on-write behaviour for BytesIO.
729728
Original file line number Diff line number Diff line change @@ -232,6 +232,8 @@ Core and Builtins
232232Library
233233-------
234234
235+ - Issue #15381: Optimized io.BytesIO to make less allocations and copyings.
236+
235237- Issue #22818: Splitting on a pattern that could match an empty string now
236238 raises a warning. Patterns that can only match empty strings are now
237239 rejected.
You can’t perform that action at this time.
0 commit comments