This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author collinwinter
Recipients alexandre.vassalotti, collinwinter
Date 2009-04-04.00:02:11
SpamBayes Score 2.0894688e-06
Marked as misclassified No
Message-id <1238803338.21.0.932870288543.issue5683@psf.upfronthosting.co.za>
In-reply-to
Content
This patch simplifies cPickle's complicated internal buffering system.
The new version uses a single buffer closer to the Pickler object,
flushing to a file object only when necessary. This avoids the overhead
of several indirection layers for what are frequently very small writes.

Benchmarked against virgin trunk r71058 using "perf.py -r -b
pickle,pickle_list,pickle_dict":

pickle:
Min: 2.225 -> 1.962: 13.37% faster
Avg: 2.254 -> 1.994: 13.03% faster
Significant (t=70.763434, a=0.95)

pickle_dict:
Min: 2.097 -> 1.418: 47.83% faster
Avg: 2.136 -> 1.446: 47.75% faster
Significant (t=214.900146, a=0.95)

pickle_list:
Min: 1.128 -> 0.777: 45.22% faster
Avg: 1.152 -> 0.807: 42.65% faster
Significant (t=169.789433, a=0.95)

A similar patch for unpickling will follow. As issue 5670 and 5671 are
committed, I'll update this patch to support them.

This patch passes all the tests added in issue 5665. I would recommend
reviewing that patch first. I'll port to py3k once this is reviewed for
trunk. This patch is available on Rietveld at
http://codereview.appspot.com/33070.
History
Date User Action Args
2009-04-04 00:02:19collinwintersetrecipients: + collinwinter, alexandre.vassalotti
2009-04-04 00:02:18collinwintersetmessageid: <1238803338.21.0.932870288543.issue5683@psf.upfronthosting.co.za>
2009-04-04 00:02:17collinwinterlinkissue5683 messages
2009-04-04 00:02:16collinwintercreate