• Home
  • Raw
  • Download

Lines Matching +full:- +full:- +full:with +full:- +full:zlib

1 Zstandard wrapper for zlib
4 …ng a zstd wrapper for [zlib](https://zlib.net/) is to allow a quick and smooth transition to zstd …
8 To build the zstd wrapper for zlib the following files are required:
9 - zlib.h
10 - a static or dynamic zlib library
11 - zlibWrapper/zstd_zlibwrapper.h
12 - zlibWrapper/zstd_zlibwrapper.c
13 - zlibWrapper/gz*.c files (gzclose.c, gzlib.c, gzread.c, gzwrite.c)
14 - zlibWrapper/gz*.h files (gzcompatibility.h, gzguts.h)
15 - a static or dynamic zstd library
17 The first two files are required by all projects using zlib and they are not included with the zstd…
18 The further files are supplied with the zstd distribution.
23 Let's assume that your project that uses zlib is compiled with:
24 ```gcc project.o -lz```
26 To compile the zstd wrapper with your project you have to do the following:
27 - change all references with `#include "zlib.h"` to `#include "zstd_zlibwrapper.h"`
28 - compile your project with `zstd_zlibwrapper.c`, `gz*.c` and a static or dynamic zstd library
31 ```gcc project.o zstd_zlibwrapper.o gz*.c -lz -lzstd```
37 Your project should work as before with zlib. There are two options to enable zstd compression:
38 - compilation with `-DZWRAP_USE_ZSTD=1` (or using `#define ZWRAP_USE_ZSTD 1` before `#include "zstd…
39 - using the `void ZWRAP_useZSTDcompression(int turn_on)` function (declared in `#include "zstd_zlib…
41 During decompression zlib and zstd streams are automatically detected and decompressed using a prop…
42 …anged using `ZWRAP_setDecompressionType(ZWRAP_FORCE_ZLIB)` what will make zlib decompression sligh…
46 We have taken the file `test/example.c` from [the zlib library distribution](https://zlib.net/) and…
49 zlib version 1.2.8 = 0x1280, compile flags = 0x65
56 inflate with dictionary: hello, hello!
58 Then we have changed `#include "zlib.h"` to `#include "zstd_zlibwrapper.h"`, compiled the [example.…
59 with `-DZWRAP_USE_ZSTD=1` and linked with additional `zstd_zlibwrapper.o gz*.c -lzstd`.
63 zlib version 1.2.8 = 0x1280, compile flags = 0x65
69 inflate with dictionary: hello, hello!
74 #### The measurement of performance of Zstandard wrapper for zlib
76 The zstd distribution contains a tool called `zwrapbench` which can measure speed and ratio of zlib
80 …ied as multiple parameters, parameters with wildcards or names of directories can be used as param…
81 One can select compression levels starting from `-b` and ending with `-e`. The `-i` parameter selec…
82 With `-B` option bigger files can be divided into smaller, independently compressed blocks.
83 The benchmark tool can be compiled with `make zwrapbench` using [zlibWrapper/Makefile](Makefile).
98 The ordinary zlib compression of two files/streams allocates two contexts:
99 - for the 1st file calls `deflateInit`, `deflate`, `...`, `deflate`, `deflateEnd`
100 - for the 2nd file calls `deflateInit`, `deflate`, `...`, `deflate`, `deflateEnd`
102 The speed of compression can be improved with reusing a single context with following steps:
103 - initialize the context with `deflateInit`
104 - for the 1st file call `deflate`, `...`, `deflate`
105 - for the 2nd file call `deflateReset`, `deflate`, `...`, `deflate`
106 - free the context with `deflateEnd`
108 To check the difference we made experiments using `zwrapbench -ri6b6` with zstd and zlib compressio…
110 The table below shows that reusing contexts has a minor influence on zlib but it gives improvement …
114 | ------------------------------------------------- | ------------| -----------| ----------- | ----…
115 | zlib 1.2.8 | 30.51 MB/s | 219.3 MB/s | 6819783 | 3.45…
116 | zlib 1.2.8 not reusing a context | 30.22 MB/s | 218.1 MB/s | 6819783 | 3.45…
117 | zlib 1.2.8 with zlibWrapper and reusing a context | 30.40 MB/s | 218.9 MB/s | 6819783 | 3.45…
118 | zlib 1.2.8 with zlibWrapper not reusing a context | 30.28 MB/s | 218.1 MB/s | 6819783 | 3.45…
121 | zstd 1.1.0 with zlibWrapper and reusing a context | 54.01 MB/s | 403.2 MB/s | 6763482 | 3.48…
122 | zstd 1.1.0 with zlibWrapper not reusing a context | 51.59 MB/s | 383.7 MB/s | 6763482 | 3.48…
126 … compression not all native zlib functions are supported. When calling unsupported methods they pu…
129 - deflateInit
130 - deflate (with exception of Z_FULL_FLUSH, Z_BLOCK, and Z_TREES)
131 - deflateSetDictionary
132 - deflateEnd
133 - deflateReset
134 - deflateBound
135 - inflateInit
136 - inflate
137 - inflateSetDictionary
138 - inflateReset
139 - inflateReset2
140 - compress
141 - compress2
142 - compressBound
143 - uncompress
144 - gzip file access functions
147 - deflateParams
150 - deflateCopy
151 - deflateTune
152 - deflatePending
153 - deflatePrime
154 - deflateSetHeader
155 - inflateGetDictionary
156 - inflateCopy
157 - inflateSync
158 - inflatePrime
159 - inflateMark
160 - inflateGetHeader
161 - inflateBackInit
162 - inflateBack
163 - inflateBackEnd