python-zstandard
python-zstandard copied to clipboard
use BlocksOutputBuffer for DecompressionObj / CompressionObj
The test in #119 improved:
0 0.000
10 0.005
20 0.011
30 0.017
40 0.024
50 0.028
60 0.034
70 0.043
80 0.051
90 0.055
100 0.058
The third commit fixed a bug, if an error occured, result
object is not DECREFed.
while (1) {
Py_BEGIN_ALLOW_THREADS zresult = ZSTD_compressStream2(
self->compressor->cctx, &self->output, &input, zFlushMode);
Py_END_ALLOW_THREADS
if (ZSTD_isError(zresult)) {
PyErr_Format(ZstdError, "error ending compression stream: %s",
ZSTD_getErrorName(zresult));
return NULL; // <---- this line
}