Antoine Pitrou added the comment:

Here are some numbers:

# Without the patch

$ ./python -m timeit -s "import pickle, io; d=pickle.dumps(list(range(1000)), 
4); b=io.BytesIO(d)" "b.seek(0); pickle.load(b)"
10000 loops, best of 3: 180 usec per loop

$ ./python -m timeit -s "import pickle, _pyio as io; 
d=pickle.dumps(list(range(1000)), 4); b=io.BytesIO(d)" "b.seek(0); 
pickle.load(b)" 
100 loops, best of 3: 4.52 msec per loop

# With the patch

$ ./python -m timeit -s "import pickle, io; d=pickle.dumps(list(range(1000)), 
4); b=io.BytesIO(d)" "b.seek(0); pickle.load(b)"
10000 loops, best of 3: 42.8 usec per loop

$ ./python -m timeit -s "import pickle, _pyio as io; 
d=pickle.dumps(list(range(1000)), 4); b=io.BytesIO(d)" "b.seek(0); 
pickle.load(b)"
10000 loops, best of 3: 47.3 usec per loop

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue17810>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to