erofs-utils: mkfs: speed up uncompressed data handling
authorGao Xiang <hsiangkao@linux.alibaba.com>
Fri, 20 Dec 2024 14:38:59 +0000 (22:38 +0800)
committerGao Xiang <hsiangkao@linux.alibaba.com>
Thu, 26 Dec 2024 05:23:35 +0000 (13:23 +0800)
commit341d23a878a295b42ddd61a3361f8f1dccb9ed67
treee51ece70249f879351d8e653c7cafb52d7af2877
parent097a518e402ab54629ea1a4b4b81ef9cc25f9a15
erofs-utils: mkfs: speed up uncompressed data handling

Currently, it only writes one uncompressed block (typically 4 KiB) and
then tries to recompress the remaining part if the entire data was
compressed and proven to be incompressible.

This is wasteful of CPU resources and slow, as such incompressible data
could be skipped entirely.

The LZMA build time for large pclusters (e.g., 512K, 1M) can be greatly
reduced if there is a significant amount of uncompressed data.

Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
Link: https://lore.kernel.org/r/20241220143859.643175-2-hsiangkao@linux.alibaba.com
lib/compress.c