Repository navigation
v2.3.0
Minor Changes
- 7300583:
lz4Compress()andlz4CompressAsync(), andcompressSync()andcompress()of@derodero24/comprs/nextfor LZ4, write the content size into the frame, aslz4 --content-sizedoes, which makes it 8 bytes longer. The synchronous LZ4 decompression functions,lz4Decompress(),lz4DecompressWithCapacity()anddecompressSync()of@derodero24/comprs/next, decode frames that declare their content size straight into the memory of their result, as the zstd ones do. A synchronous loop that gets results of 4 MiB runs 5 to 8 times as fast, and no longer holds the memory of every result until it yields (800 MiB for 200 calls); yielding between calls, it runs about 3 times as fast. - 33a9a95: Add
@derodero24/comprs/next/zstd,/gzip,/brotliand/lz4: the unified API for one family of formats each. In browsers, each loads a WebAssembly build with that family alone, 42 KB to 337 KB with gzip instead of 568 KB for every format; in Node.js, they use the native addon for the same formats. Their declarations take the formats of the family alone, and entry points imported together share their formats, with detection across them.CompressOptions,DecompressOptionsandDictionaryOptionstake the formats as an optional type parameter.
Patch Changes
- 959b268:
decompress()decodes zstd and LZ4 frames that declare their content size straight into the memory of its result, aszstdDecompress()andlz4Decompress()do, so that its large results get the same speed and memory in synchronous loops. - ceeb3f1: A stream context with an asynchronous call in flight, such as
transformAsync(), is no longer garbage-collected before the call settles, and is collected once it settles. The native addon is built with napi-rs 3.15. - b64b0fb:
decompressSync()of@derodero24/comprs/nextdecodes zstd frames that declare their content size straight into the memory of its result, aszstdDecompress()does, also when it detects the format. A synchronous loop that gets results of 4 MiB runs about 7 times as fast, and no longer holds the memory of every result until it yields (800 MiB for 200 calls). Its results also skip a zero-fill, which makes zstd results of 256 KiB to 1 MiB up to 1.7 times as fast.
Release assets
Each comprs.<abi>.node is the native addon of the npm package @derodero24/comprs-<abi>. THIRD_PARTY_LICENSES.<abi>.txt holds the license notices of the third-party code that it links statically, and LICENSE is the license of @derodero24/comprs.