Package Usage: go: modernc.org/zappy
Package zappy implements the zappy block-based compression format. It aims for
a combination of good speed and reasonable compression.
Zappy is a format incompatible, API compatible fork of snappy[1]. The C++
snappy implementation is at [2].
The snappy compression is pretty good. Yet it has one problem built into its
format definition[3] - the maximum length of a copy "instruction" is 64 bytes.
For some specific usage patterns with long runs of repeated data, it turns out
the compression is suboptimal. For example a 1:1000 "sparseness" 64kB bit index
with only few set bits is compressed to about 3kB (about 1000 of 64B copy, 3
byte "instructions").
Zappy uses much less complicated format than snappy. Each encoded block begins
with the uvarint-encoded[4] length of the decoded data, followed by a sequence
of chunks. Chunks begin and end on byte boundaries. The chunk starts with a
varint encoded number N:
Compression rate is roughly the same as of snappy for the reference data set:
Zappy has better RLE handling (1/1000+1 non zero bytes in each index):
When compiled with CGO_ENABLED=1, zappy is now faster than Go snappy.
Old=Go snappy, new=zappy:
The package builds with CGO_ENABLED=0 as well, but the performance is worse.
If a constraint 'purego' appears in the build constraints [5] then a pure Go
version is built regardless of the $CGO_ENABLED value.
... referenced from the above documentation.
11 versions
Latest release: over 1 year ago
256 dependent packages
View more package details: https://packages.ecosystem.code.gouv.fr/registries/proxy.golang.org/packages/modernc.org/zappy
Dependent Repos 7
go-hep/hep
hep is the mono repository holding all of go-hep.org/x/hep packages and toolsLast synced: 7 months ago