|
17 | 17 | //! backends, controlled through this crate's features: |
18 | 18 | //! |
19 | 19 | //! * `default`, or `rust_backend` - this implementation uses the `miniz_oxide` |
20 | | -//! crate which is a port of `miniz.c` (below) to Rust. This feature does not |
21 | | -//! require a C compiler and only requires Rust code. |
22 | | -//! |
23 | | -//! * `zlib-rs` - this implementation utilizes the `zlib-rs` crate, a pure rust rewrite of zlib. |
24 | | -//! This backend is faster than both `rust_backend` and `zlib`. However, we did not set it as the |
25 | | -//! default choice to prevent compatibility issues. |
26 | | -//! |
27 | | -//! * `zlib` - this feature will enable linking against the `libz` library, typically found on most |
28 | | -//! Linux systems by default. If the library isn't found to already be on the system it will be |
29 | | -//! compiled from source (this is a C library). |
30 | | -//! |
31 | | -//! There's various tradeoffs associated with each implementation, but in general you probably |
32 | | -//! won't have to tweak the defaults. The default choice is selected to avoid the need for a C |
33 | | -//! compiler at build time. `zlib-ng-compat` is useful if you're using zlib for compatibility but |
34 | | -//! want performance via zlib-ng's zlib-compat mode. `zlib` is useful if something else in your |
35 | | -//! dependencies links the original zlib so you cannot use zlib-ng-compat. The compression ratios |
36 | | -//! and performance of each of these feature should be roughly comparable, but you'll likely want |
37 | | -//! to run your own tests if you're curious about the performance. |
| 20 | +//! crate which is a port of `miniz.c` to Rust. This feature does not |
| 21 | +//! require a C compiler, and only uses safe Rust code. |
| 22 | +//! |
| 23 | +//! * `zlib-rs` - this implementation utilizes the `zlib-rs` crate, a Rust rewrite of zlib. |
| 24 | +//! This backend is the fastest, at the cost of some `unsafe` Rust code. |
| 25 | +//! |
| 26 | +//! Several backends implemented in C are also available. |
| 27 | +//! These are useful in the rare cases where you were already using a C implementation |
| 28 | +//! and need the result of compression to be bit-identical. |
| 29 | +//! See the crate's README for details on the available C backends. |
| 30 | +//! |
| 31 | +//! The `zlib-rs` backend typically outperforms all the C implementations. |
38 | 32 | //! |
39 | 33 | //! # Organization |
40 | 34 | //! |
|
0 commit comments