While zstd generates the very small tcz file it increases the memory usage considerably, chromium made the system memory usage at almost 420mb while lz4 left the system memory usage at 370mb. chromium was not running, simply mounted on the system! the difference in favor of zstd was that while tcz lz4 was at 180mb, tcz zstd was at approximately 108mb.
So it's a RAM Vs file size trade-off and you value RAM more. You really should have noted the figures for Gzip compression too (the x86_64 chromium-browser.tcz extension in TC 14 is 87MB, so I guess you're not using that).
In late Feb I compared these compressors in TC13 on x86_64 for compressing mydata.tar (uncompressed mydata.tgz, 112.2MB): gzip/BusyBox: BusyBox v1.34.1, lz4: 1.9.2, zstd: 1.5.0, xz: 5.2.5, bzip2: 1.0.8
I noticed that LZ4 couldn't match the compression of Gzip. I mainly boot Tiny Core from SD cards (slow), so for me LZ4 compared poorly to Zstandard which came close to the same decomression speed of LZ4 (both under 1/3rd the decompression time with Gzip) yet could also compress to a smaller file size than Gzip.
I did some more brief testing recompressing firefox.tcz (generated by firefox_getLatest.sh), which is the largest extension that I use at (then) 102.3MB. At compression level 19 Zstd reduced this to 99.4MB, but I didn't think this was really significant though. Especially because, in spite of the mydata.tar tests, loading and starting Firefox took about the same time as for the Gzip-compressed extension. I concluded that there wasn't a significant enough advantage to using Zstandard instead of Gzip for extensions.
I did find that compression of a modified rootfs-13.1.0 file for PiCore was more significantly better with Zstandard than Gzip: 2.2MB with zstd -19, 2.8MB with gzip -9. Decompression time was also slightly better for Zstd than Gzip, so seeing as I was rebuilding it anyway I decided to compress with Zstandard because that's already supported in the PiCore's build of the Linux kernel (
CONFIG_RD_ZSTD).
Linux also supports Zstandard compressed vmlinuz files since kernel version 5.9, but I think that needs the kernel to be rebuilt in order to switch the compression method that's built in to the start-up system.
Overall my conclusions (right or wrong) were:
- Zstandard compression of mydata.tar is probably worthwhile, at least for mine which is mainly Firefox profile textual data in ~/.mozilla
- Zstandard compression of extensions isn't worth it (not much smaller and somehow not much decrease in program start-up time on first run)
- Zstandard compression of the rootfs file/s should have a slight benefit for boot time
- Zstandard compression of vmlinuz has an unknown advantage and it probably isn't worth the trouble to build the kernel just to try and test it
- LZ4, XZ, BZIP2, are worse than Gzip - either much slower (XZ, BZIP2) or larger compressed files (LZ4) at all compression settings tested
I understand that Zstandard's main advantage over Gzip is for compressing text-based files that are at least a few megabytes in size, because then it can use its dictionary-based techniques for improving compression.