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
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
8000 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 documentation with gzip speed improvements
  • Loading branch information
rhpvorderman committed Aug 25, 2021
commit 8ddee293b19215c811f4998a44ed74c8b1ec400c
17 changes: 14 additions & 3 deletions Doc/library/gzip.rst
Original file line number Diff line number Diff line change
Expand Up @@ -174,19 +174,30 @@ The module defines the following items:

Compress the *data*, returning a :class:`bytes` object containing
the compressed data. *compresslevel* and *mtime* have the same meaning as in
the :class:`GzipFile` constructor above.
the :class:`GzipFile` constructor above. When *mtime* is set to ``0``, this
function is equivalent to :func:`zlib.compress` with *wbits* set to ``31``.
The zlib function is faster.

.. versionadded:: 3.2
.. versionchanged:: 3.8
Added the *mtime* parameter for reproducible output.
.. versionchanged:: 3.11
Speed is improved by compressing all data at once instead of in a
streamed fashion. Calls with *mtime* set to ``0`` are delegated to
:func:`zlib.compress` for better speed.

.. function:: decompress(data)

Decompress the *data*, returning a :class:`bytes` object containing the
uncompressed data.
uncompressed data. This function is capable of decompressing multi-member
gzip data (multiple gzip blocks concatenated together). When the data is
certain to contain only one member the :func:`zlib.decompress` function with
*wbits* set to 31 is faster.

.. versionadded:: 3.2

.. versionchanged:: 3.11
Speed is improved by decompressing members at once in memory instead of in
a streamed fashion.

.. _gzip-usage-examples:

Expand Down
0