mirror of
https://github.com/python/cpython.git
synced 2025-11-25 04:34:37 +00:00
#1792: Improve performance of marshal.dumps() on large objects by increasing
the size of the buffer more quickly.
This commit is contained in:
parent
ab756f60bd
commit
6c02916dfb
2 changed files with 12 additions and 1 deletions
|
|
@ -255,6 +255,14 @@ class BugsTestCase(unittest.TestCase):
|
|||
subtyp = type('subtyp', (typ,), {})
|
||||
self.assertRaises(ValueError, marshal.dumps, subtyp())
|
||||
|
||||
# Issue #1792 introduced a change in how marshal increases the size of its
|
||||
# internal buffer; this test ensures that the new code is exercised.
|
||||
def test_large_marshal(self):
|
||||
size = int(1e6)
|
||||
testString = 'abc' * size
|
||||
marshal.dumps(testString)
|
||||
|
||||
|
||||
def test_main():
|
||||
test_support.run_unittest(IntTestCase,
|
||||
FloatTestCase,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue