https://github.com/thomasmueller/lz4_simple
LZ4 implementation
https://github.com/thomasmueller/lz4_simple
Last synced: about 1 year ago
JSON representation
LZ4 implementation
- Host: GitHub
- URL: https://github.com/thomasmueller/lz4_simple
- Owner: thomasmueller
- License: apache-2.0
- Created: 2023-11-03T15:52:09.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-12-14T20:45:09.000Z (over 2 years ago)
- Last Synced: 2025-02-09T16:43:54.378Z (over 1 year ago)
- Language: Rust
- Size: 37.1 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Simple LZ4
A very simple LZ4 implementation.
## Usage
lz4_simple -1 Compress the input file into the output file (faster)
lz4_simple -9 Compress the input file into the output file (smaller)
lz4_simple -d Decompress the input file into the output file
lz4_simple -h Calculate the XXHash32 checksum
## Features
* Compress a file.
* Decompress a compressed file (only default settings are supported).
* Calculate the XXHash32 checksum of a file.
* Written in Rust.
* Simple and short implementation.
* 100% safe code.
## Performance
The following numbers are including disk I/O:
* ~0.6 GB/s compression, which is a bit slower than the "lz4" command line tool.
* ~1 GB/s decompression, which is similar to the "lz4" command line tool.
* ~3 GB/s checksum, which is around half as fast as the "crc32" command line tool.
## Code Coverage
Install:
cargo install rustfilt
rustup component add llvm-tools-preview
find ~/.rustup -name llvm-profdata
open ~/.zprofile
Cleanup:
rm *.prof*
Coverage of one run:
RUSTFLAGS="-C instrument-coverage" cargo build
./target/debug/lz4_simple -h test.txt
llvm-profdata merge -sparse default_*.profraw -o prof.profdata
llvm-cov show -Xdemangler=rustfilt ./target/debug/lz4_simple \
-instr-profile=prof.profdata \
-show-line-counts-or-regions \
-show-instantiations \
-name-regex=".*"
Coverage of tests:
cargo clean
RUSTFLAGS="-C instrument-coverage" cargo test
llvm-profdata merge -sparse default_*.profraw -o prof.profdata
FILE=`find ./target/debug/deps -type f ! -name "*.*"`
llvm-cov show -Xdemangler=rustfilt ${FILE} \
-instr-profile=prof.profdata \
-show-line-counts-or-regions \
-show-instantiations \
-name-regex=".*"