Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Buffer file reads in
serde_json::from_reader
(#10341)
<!-- Thank you for contributing to uv! To help us out with reviewing, please consider the following: - Does this pull request include a summary of the change? (See below.) - Does this pull request include a descriptive title? - Does this pull request include references to any relevant issues? --> ## Summary https://docs.rs/serde_json/latest/serde_json/fn.from_reader.html suggests that > When reading from a source against which short reads are not efficient, such as a [File](https://doc.rust-lang.org/std/fs/struct.File.html), you will want to apply your own buffering because serde_json will not buffer the input. See [std::io::BufReader](https://doc.rust-lang.org/std/io/struct.BufReader.html). Without this buffering, we observe a sequence of single byte reads which can be quite inefficient depending on the underlying filesystem. This adds buffering with `std::io::BufReader` to resolve this. <!-- What's the purpose of the change? What does it do, and why? --> ## Test Plan Unit tests cover this code. <!-- How was it tested? -->
- Loading branch information