Skip to content

Commit c5502d6

Browse files
authored
Merge pull request #27 from pycompression/threading
Integrate threading modules from python-isal
2 parents 8b1128a + 094a9c0 commit c5502d6

File tree

9 files changed

+901
-1
lines changed

9 files changed

+901
-1
lines changed

CHANGELOG.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ Changelog
99
1010
version 0.4.0-dev
1111
-----------------
12+
+ Add a ``gzip_ng_threaded`` module that contains the ``gzip_ng_threaded.open``
13+
function. This allows using multithreaded compression as well as escaping the
14+
GIL.
1215
+ The internal ``gzip_ng._GzipReader`` has been rewritten in C. As a result the
1316
overhead of decompressing files has significantly been reduced.
1417
+ The ``gzip_ng._GzipReader`` in C is now used in ``gzip_ng.decompress``. The

README.rst

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ by providing Python bindings for the zlib-ng library.
4242
This package provides Python bindings for the `zlib-ng
4343
<https://github.com/zlib-ng/zlib-ng>`_ library.
4444

45-
``python-zlib-ng`` provides the bindings by offering two modules:
45+
``python-zlib-ng`` provides the bindings by offering three modules:
4646

4747
+ ``zlib_ng``: A drop-in replacement for the zlib module that uses zlib-ng to
4848
accelerate its performance.
@@ -51,6 +51,11 @@ This package provides Python bindings for the `zlib-ng
5151
instead of ``zlib`` to perform its compression and checksum tasks, which
5252
improves performance.
5353

54+
+ ``gzip_ng_threaded`` offers an ``open`` function which returns buffered read
55+
or write streams that can be used to read and write large files while
56+
escaping the GIL using one or multiple threads. This functionality only
57+
works for streaming, seeking is not supported.
58+
5459
``zlib_ng`` and ``gzip_ng`` are almost fully compatible with ``zlib`` and
5560
``gzip`` from the Python standard library. There are some minor differences
5661
see: differences-with-zlib-and-gzip-modules_.
@@ -68,6 +73,7 @@ The python-zlib-ng modules can be imported as follows
6873
6974
from zlib_ng import zlib_ng
7075
from zlib_ng import gzip_ng
76+
from zlib_ng import gzip_ng_threaded
7177
7278
``zlib_ng`` and ``gzip_ng`` are meant to be used as drop in replacements so
7379
their api and functions are the same as the stdlib's modules.

docs/index.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,13 @@ API-documentation: zlib_ng.gzip_ng
113113
:members:
114114
:special-members: __init__
115115

116+
===========================================
117+
API-documentation: zlib_ng.gzip_ng_threaded
118+
===========================================
119+
120+
.. automodule:: zlib_ng.gzip_ng_threaded
121+
:members: open
122+
116123
===============================
117124
python -m zlib_ng.gzip_ng usage
118125
===============================

0 commit comments

Comments
 (0)