LZ4_compress_fast(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

Hiii bestie πŸ’– welcome to the LZ4_compress_fast(9) page β€” this is the Kernel API Manual, and we’re about to make this acceleration param make sense, fr fr. ✨

🌸 NAME 🌸

LZ4_compress_fast β€” it’s literally as LZ4_compress_default, providing an acceleration param. Same bestie energy, but with a speed dial. πŸŽ€

✨ SYNOPSIS ✨

Okay, the exact signature is giving main character energy:

int LZ4_compress_fast (const char *source , char *dest , int inputSize ,
int maxOutputSize , int acceleration , void *wrkmem );

πŸŽ€ ARGUMENTS πŸŽ€

  • source β€” source address of the original data. That’s where the original data starts, bestie. πŸ¦‹
  • dest β€” output buffer address of the compressed data. The compressed output goes here. πŸ’…
  • inputSize β€” size of the input data. Max supported value is LZ4_MAX_INPUT_SIZE. πŸ‘‘
  • maxOutputSize β€” full or partial size of buffer 'dest' which must be already allocated. No surprise mallocs, okay? πŸ™ˆ
  • acceleration β€” acceleration factor. This is the speed dial, lowkey. πŸ”₯
  • wrkmem β€” address of the working memory. This requires 'workmem' of LZ4_MEM_COMPRESS. 🧚

πŸ’… DESCRIPTION πŸ’…

Same as LZ4_compress_default, but it allows you to select an "acceleration" factor. The larger the acceleration value, the faster the algorithm, but also the lesser the compression. It’s a trade-off, no cap. βš–οΈ

It can be fine tuned, with each successive value providing roughly +~3% to speed. An acceleration value of "1" is the same as regular LZ4_compress_default. Values <= 0 will be replaced by LZ4_ACCELERATION_DEFAULT, which is 1. Periodt. πŸ’«

πŸ”₯ RETURN πŸ”₯

Number of bytes written into buffer 'dest' (necessarily <= maxOutputSize) or 0 if compression fails. That’s the whole vibe: bytes written, or a dramatic little zero. πŸ’€

πŸ¦‹ SEE ALSO πŸ¦‹

Kernel file ./include/linux/lz4.h β€” and the whole friend group is LZ4_compressBound(9), LZ4_compress_default(9), LZ4_compress_destSize(9), LZ4_decompress_fast(9), LZ4_decompress_safe(9), LZ4_decompress_safe_partial(9), LZ4_compress_HC(9), LZ4_resetStreamHC(9), LZ4_loadDictHC(9), LZ4_compress_HC_continue(9), LZ4_saveDictHC(9), LZ4_resetStream(9), LZ4_loadDict(9), LZ4_saveDict(9), LZ4_compress_fast_continue(9), LZ4_setStreamDecode(9), LZ4_decompress_safe_continue(9), LZ4_decompress_fast_continue(9), LZ4_decompress_safe_usingDict(9), LZ4_decompress_fast_usingDict(9). 🫢


Cute sign-off: this page comes from ./include/linux 🌸, dated October 2026, for LZ4_compress_fast(9). Bye bestie, go compress something iconic πŸ’–βœ¨
πŸ“¦ where this page comes from