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 serhiy.storchaka
Recipients Arfrever, alexandre.vassalotti, larry, pitrou, serhiy.storchaka, vstinner
Date 2013-11-26.14:55:47
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1706595.fi3yOiHNNE@raxxla>
In-reply-to <1385471681.15.0.764637205195.issue19780@psf.upfronthosting.co.za>
Content
> If it's an optimizatio, can I see some benchmarks numbers? :-)

First create two files. Run unpatched Python:

./python -c "import pickle, lzma; data = [bytes([i])*2**16 for i in 
range(256)]; with open('test.pickle4', 'wb'): pickle.dump(data, f, 4)"

Then run the same with patched Python for 'test.pickle4opt'.

Now benchmark loading.

$ ./python -m timeit "import pickle;"  "with open('test.pickle4', 'rb', 
buffering=0) as f: pickle.load(f)"
10 loops, best of 3: 52.9 msec per loop

$ ./python -m timeit "import pickle;"  "with open('test.pickle4opt', 'rb', 
buffering=0) as f: pickle.load(f)"
10 loops, best of 3: 48.9 msec per loop

The difference is about 5%. On faster computers with slower files (sockets?) it 
should be larger.
History
Date User Action Args
2013-11-26 14:55:48serhiy.storchakasetrecipients: + serhiy.storchaka, pitrou, vstinner, larry, alexandre.vassalotti, Arfrever
2013-11-26 14:55:48serhiy.storchakalinkissue19780 messages
2013-11-26 14:55:47serhiy.storchakacreate