Antoine Pitrou <pit...@free.fr> added the comment: > * The read*() methods are implemented very inefficiently. Since they > have to deal with the bytes objects returned by > BZ2Decompressor.decompress(), a large read results in lots of > allocations that weren't necessary in the C implementation.
It probably depends on the buffer size. Trying to fix this /might/ be premature optimization. Also, as with GzipFile one goal should be for BZFile to be wrappable in a io.BufferedReader, which has its own very fast buffering layer (and also a fast readline() if you implement peek() in BZFile). > * Fixed a typo in test_bz2's testReadChunk10() that caused the test to > pass regardless of whether the data read was correct > (self.assertEqual(text, text) -> self.assertEqual(text, self.TEXT)). > This one might be worth committing now, since it isn't dependent on > the rewrite. Ah, thank you. Will take a look. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue5863> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com