Serhiy Storchaka added the comment: And here are other patch, which not only fixes an issue with quadratic complexity, but optimize b32encode and b32decode about 2.5 times.
Microbenchmarks: ./python -m timeit -r 1 -n 10 -s "from base64 import b32encode as encode; data = open('python', 'rb').read(1000001)" "encode(data)" ./python -m timeit -r 1 -n 1 -s "from base64 import b32encode as encode, b32decode as decode; data = encode(open('python', 'rb').read(1000001))" "decode(data)" Results: First patch Second patch b32encode 1.25 sec 486 msec b32decode 2.08 sec 835 msec ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue17812> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com