mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
Issue #9410: Various optimizations to the pickle module, leading to
speedups up to 4x (depending on the benchmark). Mostly ported from Unladen Swallow; initial patch by Alexandre Vassalotti.
This commit is contained in:
parent
350c7229be
commit
ea99c5c949
5 changed files with 1885 additions and 548 deletions
|
@ -1068,6 +1068,15 @@ class AbstractPickleTests(unittest.TestCase):
|
|||
dumped = self.dumps(set([3]), 2)
|
||||
self.assertEqual(dumped, DATA6)
|
||||
|
||||
def test_large_pickles(self):
|
||||
# Test the correctness of internal buffering routines when handling
|
||||
# large data.
|
||||
for proto in protocols:
|
||||
data = (1, b'x' * (256 * 1024))
|
||||
dumped = self.dumps(data, proto)
|
||||
loaded = self.loads(dumped)
|
||||
self.assertEqual(loaded, data)
|
||||
|
||||
|
||||
# Test classes for reduce_ex
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue