mirror of
https://github.com/google/brotli.git
synced 2026-07-08 17:56:58 +00:00
[PR #902] [MERGED] Python: use a new output buffer code #1475
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/google/brotli/pull/902
Author: @ghost
Created: 5/3/2021
Status: ✅ Merged
Merged: 12/29/2022
Merged by: @eustas
Base:
master← Head:blocks_output_buffer_v3📝 Commits (10+)
331a24c1. blocks output bufferbaa30fd2. brotli_decompressd5326ab3. compress_streamf1d04a94. brotli_Compressor_process84581275. brotli_Compressor_flush25549fc6. brotli_Compressor_finish71eaefb7. decompress_streamd37501c8. brotli_Decompressor_process9755e259. brotli_Decompressor_is_finished5f379e310. remove C++ code📊 Changes
2 files changed (+396 additions, -174 deletions)
View changed files
📝
python/_brotli.c(+372 -142)📝
setup.py(+24 -32)📄 Description
Currently, the output buffer is a
std::vector<uint8_t>.When the buffer grows, resizing will cause unnecessary
memcpy().This PR uses a list of bytes object to represent output buffer, can avoid the extra overhead of resizing.
In addition, C++ code can be removed, it's a pure C extension.
Please review the 11 commits one by one.
May 3, 2021 update:
Maybe the block sizes can be adjusted to better suit web applications.
Currently, the first block is 32KB, the second block is 64KB, ...
Benchmarks:
Benchmark code:
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.