https://github.com/composewell/streamly-lz4
Streamly combinators for LZ4 compression.
https://github.com/composewell/streamly-lz4
compression lz4 streamly
Last synced: about 1 year ago
JSON representation
Streamly combinators for LZ4 compression.
- Host: GitHub
- URL: https://github.com/composewell/streamly-lz4
- Owner: composewell
- License: apache-2.0
- Created: 2020-12-14T11:14:38.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-03-10T09:02:02.000Z (over 3 years ago)
- Last Synced: 2025-04-15T23:09:40.959Z (about 1 year ago)
- Topics: compression, lz4, streamly
- Language: C
- Homepage:
- Size: 235 KB
- Stars: 5
- Watchers: 3
- Forks: 0
- Open Issues: 13
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# streamly-lz4
This library uses the LZ4 compression algorithm
to compress and decompress a data stream
using [Haskell Streamly](https://streamly.composewell.com/).
## Running benchmarks
`download-corpora.sh` downloads and unpacks the [caterbury
corpus](https://corpus.canterbury.ac.nz/) used for benchmarking.
Run the following commands from the top level directory in the repo:
```
$ ./download-corpora.sh
$ cabal run bench-lz4 -- --quick
```
To use [fusion-plugin](https://github.com/composewell/fusion-plugin) for
benchmarks:
```
$ cabal run --flag fusion-plugin bench-lz4 -- --quick
```
### Benchmarking an external corpus
`BENCH_STREAMLY_LZ4_FILE` is looked up for file to benchmark. This should
contain the absolute path of the target file.
`BENCH_STREAMLY_LZ4_STRATEGY` is looked up for which benchmarking combinator to
run on the target file.
It can contain values of the following structure,
- `c+speed+bufsize`
- `d+bufsize`
- `r+bufsize`
`c` corresponds to compress, `d` for decompress and `r` for resizing.
Example,
```
$ export BENCH_STREAMLY_LZ4_FILE="path/to/file/"
$ export BENCH_STREAMLY_LZ4_STRATEGY="c+400+640000"
$ cabal bench
```
The commands above runs the compression bench suite on **path/to/file/** with
the acceleration value of **500** read as arrays of size **640000** bytes.
*Note*: For the decompression and resizing bench suite a compressed file is
expected as input.