summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_marshal.py
diff options
context:
space:
mode:
authorAndrew M. Kuchling <amk@amk.ca>2008-05-11 13:33:56 (GMT)
committerAndrew M. Kuchling <amk@amk.ca>2008-05-11 13:33:56 (GMT)
commit6c02916dfbdad27f26888c287d2cfa5639667731 (patch)
tree153688377587615ef56c0c086bd73fa403331c3d /Lib/test/test_marshal.py
parentab756f60bdef88f15cc94c77e0752c6c7c8d708f (diff)
downloadcpython-6c02916dfbdad27f26888c287d2cfa5639667731.zip
cpython-6c02916dfbdad27f26888c287d2cfa5639667731.tar.gz
cpython-6c02916dfbdad27f26888c287d2cfa5639667731.tar.bz2
#1792: Improve performance of marshal.dumps() on large objects by increasing
the size of the buffer more quickly.
Diffstat (limited to 'Lib/test/test_marshal.py')
-rw-r--r--Lib/test/test_marshal.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/test/test_marshal.py b/Lib/test/test_marshal.py
index 1b2c8b7..943aa55 100644
--- a/Lib/test/test_marshal.py
+++ b/Lib/test/test_marshal.py
@@ -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,