ebfe <knabberknusperh...@yahoo.de> added the comment: new svn diff attached
the indentation in this file is not my fault, it has tabs all over it... The 5kb limits protects from the overhead of releasing the GIL. With very small buffers the overall runtime in my benchmark tends to double. I set it based on my testing and it remains being arbitrary to a certain degree. Set the limit to 1 and try 1.000.000 times b'abc'... May I also suggest to change the zlib module not to accept s* but y*: - Internally zlib operates on bytes, characters don't mean a thing in zlib-land. - We rely on s* performing the encoding into default for us. This behaviour is hidden from the programmer and somewhat violates the rule of least surprise. - type(zlib.decompress(zlib.compress('abc'))) == bytes - Changing from s* to y* forces the programmer to use .encode() on his strings (e.g. zlib.compress('abc'.encode()) which very clearly shows what's happening. Added file: http://bugs.python.org/file12466/zlib_threads-2.diff _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue4738> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com