summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_pickle.py
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2010-09-09 18:33:21 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2010-09-09 18:33:21 (GMT)
commitea99c5c94985c21d8a64c9a3d753bde7f801c14a (patch)
tree193ab657d8c66abf7b3147b17b5d1fe7c79f3c87 /Lib/test/test_pickle.py
parent350c7229be7b288e2f4c93d0ae2e111cb15f640e (diff)
downloadcpython-ea99c5c94985c21d8a64c9a3d753bde7f801c14a.zip
cpython-ea99c5c94985c21d8a64c9a3d753bde7f801c14a.tar.gz
cpython-ea99c5c94985c21d8a64c9a3d753bde7f801c14a.tar.bz2
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.
Diffstat (limited to 'Lib/test/test_pickle.py')
-rw-r--r--Lib/test/test_pickle.py15
1 files changed, 14 insertions, 1 deletions
diff --git a/Lib/test/test_pickle.py b/Lib/test/test_pickle.py
index bb681bf..7f642c8 100644
--- a/Lib/test/test_pickle.py
+++ b/Lib/test/test_pickle.py
@@ -37,6 +37,18 @@ class PyPicklerTests(AbstractPickleTests):
return u.load()
+class InMemoryPickleTests(AbstractPickleTests):
+
+ pickler = pickle._Pickler
+ unpickler = pickle._Unpickler
+
+ def dumps(self, arg, proto=None):
+ return pickle.dumps(arg, proto)
+
+ def loads(self, buf):
+ return pickle.loads(buf)
+
+
class PyPersPicklerTests(AbstractPersistentPicklerTests):
pickler = pickle._Pickler
@@ -95,7 +107,8 @@ def test_main():
tests.extend([CPicklerTests, CPersPicklerTests,
CDumpPickle_LoadPickle, DumpPickle_CLoadPickle,
PyPicklerUnpicklerObjectTests,
- CPicklerUnpicklerObjectTests])
+ CPicklerUnpicklerObjectTests,
+ InMemoryPickleTests])
support.run_unittest(*tests)
support.run_doctest(pickle)