8000 bpo-43613: Faster implementation of gzip.compress and gzip.decompress by rhpvorderman · Pull Request #27941 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

bpo-43613: Faster implementation of gzip.compress and gzip.decompress #27941

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 22 commits into from
Sep 2, 2021
Merged
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
608876c
Add test for zlib.compress wbits
rhpvorderman Mar 24, 2021
12fb5a5
Add wbits argument to zlib.compress
rhpvorderman Mar 24, 2021
1b34510
Use clinic to generate input
rhpvorderman Mar 24, 2021
4e90311
Update documentation for zlib
rhpvorderman Mar 24, 2021
9717252
Add blurb news entry for zlib.compress wbits parameter
rhpvorderman Mar 24, 2021
d70390e
Fix doc typo
rhpvorderman Mar 24, 2021
c819e3e
Remove unnecessary whitespace, add punctionation and complete sentences.
rhpvorderman Jun 1, 2021
1f3481f
Break line to comply with PEP-7
rhpvorderman Jun 1, 2021
8019932
Update blurb to include :func: reference
rhpvorderman Jun 1, 2021
0ea98cf
Remove erroneous double backticks
rhpvorderman Jun 1, 2021
d1c86dc
Faster gzip.compress implementation
rhpvorderman Aug 24, 2021
19a0358
More efficiently decompress gzip files in memory
rhpvorderman Aug 24, 2021
5155857
Ensure correct endianness
rhpvorderman Aug 24, 2021
fa188a6
Remove redundant line
rhpvorderman Aug 24, 2021
4e76cf5
Fix typos and test errors
rhpvorderman Aug 24, 2021
0280c95
Revert changing default on compress for backwards compatibility
rhpvorderman Aug 25, 2021
8000
8ddee29
Update documentation with gzip speed improvements
rhpvorderman Aug 25, 2021
77f79fd
Add a blurb for gzip speed improvements
rhpvorderman Aug 25, 2021
ca3e543
Use + instead of bytes.join() method
rhpvorderman Aug 25, 2021
f881f7e
Reword docstring for read_gzip_header
rhpvorderman Aug 30, 2021
97a8100
Update docstring for gzip.compress
rhpvorderman Aug 30, 2021
eeb7766
Use subtest for zlib.compress/decompress test.
rhpvorderman Aug 30, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update docstring for gzip.compress
  • Loading branch information
< 8000 div class="flex-auto pb-2 pb-md-0"> rhpvorderman committed Aug 30, 2021
commit 97a8100b81d0bd8fa7ee2b58e41d18764f6a4438
9 changes: 5 additions & 4 deletions Lib/gzip.py
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ def _read_exact(fp, n):

def _read_gzip_header(fp):
'''Read a gzip header from `fp` and progress to the end of the header.

Returns last mtime if header was present or None otherwise.
'''
magic = fp.read(2)
Expand Down Expand Up @@ -579,9 +579,10 @@ def _create_simple_gzip_header(compresslevel: int,

def compress(data, compresslevel=_COMPRESS_LEVEL_BEST, *, mtime=None):
"""Compress data in one shot and return the compressed string.
Optional argument is the compression level, in range of 0-9.
mtime can be used to set the modification time. 0 is default,
use 'None' for current time.

compresslevel sets the compression level in range of 0-9.
mtime can be used to set the modification time. The modification time is
set to the current time by default.
"""
if mtime == 0:
# Use zlib as it creates the header with 0 mtime by default.
Expand Down
0