-
Notifications
You must be signed in to change notification settings - Fork 143
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cap buffer sizes via
ZlibStream::set_max_total_output
. (#429)
* Roll the `fdeflate` dependency to version 0.3.3 * Cap buffer sizes via `ZlibStream::set_max_total_output`. Before this commit, `ZlibStream::new` would always allocate and zero out 64kB of data via `out_buffer: vec![0; 2 * CHUNCK_BUFFER_SIZE]`. After this commit, `out_buffer` is capped by the actual size of the decompressed image data. `StreamingDecoder::parse_ihdr` estimates the image size and notifies `ZlibStream` via the new `set_max_total_output` method. Impact on the runtime of the `decode/generated-png:noncompressed-8x8.png` benchmark (3 measurements): * [-24.028% -23.693% -23.460%] (p = 0.00 < 0.05) * [-23.830% -23.480% -23.200%] (p = 0.00 < 0.05) * [-21.259% -20.893% -20.618%] (p = 0.00 < 0.05)
- Loading branch information
1 parent
d761f16
commit c4121b5
Showing
4 changed files
with
82 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters