I'm pleased to announce the release of version 1.1.4 of the buffered reader crate. It has been published on crates.io:
You can also fetch it using the buffered-reader/v1.1.4 tag:
which I signed:
$ git verify-tag buffered-reader/v1.1.4 gpg: Signature made Fri Jan 6 21:40:10 2023 GMT gpg: using RSA key C03FA6411B03AE12576461187223B56678E02528 gpg: Good signature from "Neal H. Walfield firstname.lastname@example.org" gpg: "Neal H. Walfield email@example.com" gpg: "Neal H. Walfield firstname.lastname@example.org" gpg: "Neal H. Walfield email@example.com" gpg: "Neal H. Walfield firstname.lastname@example.org" gpg: "Neal H. Walfield email@example.com"
This release fixes a performance bug in the generic buffered reader (`buffered_reader::Generic`). When the amount of data that is requested (e.g., via `BufferedReader::data`) exceeds the default buffer size, exactly that amount of data was read from the underlying reader. This is problematic for two reasons. First, as users of a buffered reader often do not immediately consume the data that is read, most reads are forwarded to the underlying buffered reader. Second, most reads are for one byte. Because `buffered_reader::Generic` keeps all data in a single vec, this resulted in a lot of copying, which hurt performance.
Neal on behalf of the whole Sequoia PGP team