Crates.io | salzweg |
lib.rs | salzweg |
version | 0.1.4 |
source | src |
created_at | 2022-06-07 15:04:07.182611 |
updated_at | 2022-10-25 14:33:22.500754 |
description | A LZW encoder and decoder, fast and memory efficient |
homepage | |
repository | https://github.com/redwarp/lzw |
max_upload_size | |
id | 601530 |
size | 104,177 |
Salzweg is a LZW encoder and decoder. It supports the GIF flavored, TIFF flavored and fixed code flavors of LZW.
LZW is a universal lossless data compression algorithm.
The aim of this library is to be memory efficient, and fast.
First, a few formulas
Using criterion on a AMD Ryzen 7 2700X Eight-Core Processor 3.70 GHz CPU
, I observed the following throughput when processing data:
Variable encoder | Fix 12 bit size | |
---|---|---|
Compressing image data | 70 MiB/s | 120 MiB/s |
Decompressing image data | 200 MiB/s | 210 MiB/s |
Compressing lorem ipsum text | 70 MiB/s | 85 MiB/s |
Decompressing lorem ipsum text | 200 MiB/s | 220 MiB/s |
These timings are rounded, indicative more than 100% accurate. But they are consistently faster than the LZW and Weezl crate for encoding, and consistently faster than the Weezl crate for decoding (I did not try to decode with LZW, as the comparison is difficult due to API design).
Code is licensed under MIT.