All Projects → valyala → Gozstd

valyala / Gozstd

Licence: mit
go wrapper for zstd

Programming Languages

c
50402 projects - #5 most used programming language
go
31211 projects - #10 most used programming language
golang
3204 projects

Projects that are alternatives of or similar to Gozstd

Dwarfs
A fast high compression read-only file system
Stars: ✭ 444 (+61.45%)
Mutual labels:  zstd, compression
Turbobench
Compression Benchmark
Stars: ✭ 211 (-23.27%)
Mutual labels:  zstd, compression
Lzbench
lzbench is an in-memory benchmark of open-source LZ77/LZSS/LZMA compressors
Stars: ✭ 490 (+78.18%)
Mutual labels:  zstd, compression
Compress
Optimized Go Compression Packages
Stars: ✭ 2,478 (+801.09%)
Mutual labels:  compression, zstd
zstd-rs
zstd-decoder in pure rust
Stars: ✭ 148 (-46.18%)
Mutual labels:  compression, zstd
Lizard
Lizard (formerly LZ5) is an efficient compressor with very fast decompression. It achieves compression ratio that is comparable to zip/zlib and zstd/brotli (at low and medium compression levels) at decompression speed of 1000 MB/s and faster.
Stars: ✭ 408 (+48.36%)
Mutual labels:  zstd, compression
Zstdnet
Zstd wrapper for .NET
Stars: ✭ 176 (-36%)
Mutual labels:  zstd, compression
Zipfly
Writing large ZIP archives without memory inflation
Stars: ✭ 363 (+32%)
Mutual labels:  streaming, compression
ZstdKit
An Objective-C and Swift library for Zstd (Zstandard) compression and decompression.
Stars: ✭ 22 (-92%)
Mutual labels:  compression, zstd
ZRA
ZStandard Random Access (ZRA) allows random access inside an archive compressed using ZStandard
Stars: ✭ 21 (-92.36%)
Mutual labels:  compression, zstd
Zstd Rs
A rust binding for the zstd compression library.
Stars: ✭ 159 (-42.18%)
Mutual labels:  zstd, compression
pyrus-cramjam
Thin Python wrapper to de/compression algorithms in Rust - lightweight & no dependencies
Stars: ✭ 40 (-85.45%)
Mutual labels:  compression, zstd
xcdat
Fast compressed trie dictionary library
Stars: ✭ 51 (-81.45%)
Mutual labels:  compression, dictionary
ratarmount
Random Access Read-Only Tar Mount
Stars: ✭ 217 (-21.09%)
Mutual labels:  compression, zstd
EasyCompressor
⚡ A compression library that implements many compression algorithms such as LZ4, Zstd, LZMA, Snappy, Brotli, GZip, and Deflate. It helps you to improve performance by reducing Memory Usage and Network Traffic for caching.
Stars: ✭ 167 (-39.27%)
Mutual labels:  compression, zstd
Rocketjob
Ruby's missing background and batch processing system
Stars: ✭ 258 (-6.18%)
Mutual labels:  compression
Pushpin
Proxy server for adding push to your API
Stars: ✭ 3,050 (+1009.09%)
Mutual labels:  streaming
Rtspallthethings
Deprecated RTSP media server -- Use github.com/aler9/rtsp-simple-server instead.
Stars: ✭ 258 (-6.18%)
Mutual labels:  streaming
Graphql Deduplicator
A GraphQL response deduplicator. Removes duplicate entities from the GraphQL response.
Stars: ✭ 258 (-6.18%)
Mutual labels:  compression
Fd Dictionaries
hand-written dictionaries from the FreeDict project
Stars: ✭ 268 (-2.55%)
Mutual labels:  dictionary

Build Status GoDoc Go Report codecov

gozstd - go wrapper for zstd

Features

  • Vendors upstream zstd without any modifications.

  • Simple API.

  • Optimized for speed. The API may be easily used in zero allocations mode.

  • Compress* and Decompress* functions are optimized for high concurrency.

  • Proper Writer.Flush for network apps.

  • Supports the following features from upstream zstd:

    • Block / stream compression / decompression with all the supported compression levels and with dictionary support.
    • Dictionary building from a sample set. The created dictionary may be saved to persistent storage / transfered over the network.
    • Dictionary loading for compression / decompression.

    Pull requests for missing upstream zstd features are welcome.

Quick start

How to install gozstd?

go get -u github.com/valyala/gozstd

How to compress data?

The easiest way is just to use Compress:

	compressedData := Compress(nil, data)

There is also StreamCompress and Writer for stream compression.

How to decompress data?

The easiest way is just to use Decompress:

	data, err := Decompress(nil, compressedData)

There is also StreamDecompress and Reader for stream decompression.

How to cross-compile gozstd?

If you're cross-compiling some code that uses gozstd and you stumble upon the following error:

# github.com/valyala/gozstd
/go/pkg/mod/github.com/valyala/[email protected]/stream.go:31:59: undefined: CDict
/go/pkg/mod/github.com/valyala/[email protected]/stream.go:35:64: undefined: CDict
/go/pkg/mod/github.com/valyala/[email protected]/stream.go:47:20: undefined: Writer

You can easily fix it by enabling CGO and using a cross-compiler (e.g. arm-linux-gnueabi-gcc):

env CC=arm-linux-gnueabi-gcc GOOS=linux GOARCH=arm CGO_ENABLED=1 go build ./main.go 

NOTE: Check #21 for more info.

Who uses gozstd?

FAQ

  • Q: Which go version is supported?
    A: go1.10 and newer. Pull requests for older go versions are accepted.

  • Q: Which platforms/architectures are supported?
    A: linux/amd64, linux/arm, linux/arm64, freebsd/amd64, darwin/amd64, windows/amd64. Pull requests for other platforms/architectures are accepted.

  • Q: I don't trust libzstd*.a binary files from the repo or these files dont't work on my OS/ARCH. How to rebuild them? A: Just run make clean libzstd.a if your OS/ARCH is supported.

  • Q: How do I specify custom build flags when recompiling libzstd*.a? A: You can specify MOREFLAGS=... variable when running make like this: MOREFLAGS=-fPIC make clean libzstd.a.

  • Q: Why the repo contains libzstd*.a binary files?
    A: This simplifies package installation to usual go get without additional steps for building the libzstd*.a

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].