Skip to content

LunaPack 0.1.3

Choose a tag to compare

@github-actions github-actions released this 04 Nov 07:40
· 97 commits to master since this release

LunaPack 0.1.3

LZ4, and a packing that is much faster.

The toolchain ships no LZ4, so the block format and the frame format of the
reference implementation are written here in pure MoonBit, together with
the xxHash32 that the frame header needs. What is produced is a standard
.lz4 frame: the lz4 tool decompresses it, and this package decompresses
what that tool produces. Both directions are covered by the test suite.

The codec is chosen with --compression-method, which takes none, gzip, lz4
or auto. Measured on an application of 392 files and 332 MB:

packing gzip 39 s lz4 16 s
unpacking gzip 21 s lz4 19 s
size gzip 139 MB lz4 175 MB

LZ4 does no entropy coding at all, so it is much faster while producing a
larger result. The gzip codec moves to moonbitlang/core/compress/gzip,
which is faster in both directions and produces a smaller result than the
stream implementation did; the two read each other.

Three things that made the packing slower than it had to be are gone: the
unpack read every extracted file back twice, the fingerprint of the
produced file was computed by reading the whole file back, and a path at
the root of a drive failed.

The manifest format version goes to 4, because an entry may now name the
lz4 codec. A package written by an older version still unpacks.

42/42 tests pass on the native and the wasm backend.