Serhiy Storchaka added the comment: > 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. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue19780> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com