[issue16034] bz2 module appears slower in Python 3.x versus Python 2.x

Nadeem Vawda report at bugs.python.org
Sun Sep 30 13:16:09 CEST 2012


Nadeem Vawda added the comment:

> Yes, of course.

Awesome. I plan to do a new release for this in the next couple of days.


> We can even speed up 1.5 times the reading of small chunks, if we inline _check_can_read() and _read_block().

Interesting idea, but I don't think it's worthwhile. It looks like this is only a noticeable improvement if size is 10 or 1, and I don't think these are common cases (especially not for users who care about performance). Also, I'm reluctant to have two copies of the code for _read_block(); it makes the code harder to read, and increases the chance of introducing a bug when changing the code.


> The same approach is applied for LZMAFile.

Of course. I'll apply these optimizations to LZMAFile next weekend.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue16034>
_______________________________________


More information about the Python-bugs-list mailing list