Trying to set up multi-core support for mc's folder compression user menu ability, I was looking into the options of the compression programs used - gzip (.gz), bzip2 (.bz2), 7za (.7z), xz (.xz), zstd (.zst).
Some are threadable, others not.
Looking into it I found options some of you might find useful, and it is easy to tweak the mc user menu into using such options.
E.g. gzip - could be you find this option
Code: Select all
--rsyncable make rsync-friendly archive
Easily to implement. Just change the original line from /etc/mc/mc.menu from
Code: Select all
tar cf - "$Pwd" | gzip -f9 > "$tar.tar.gz" && \
Code: Select all
tar cf - "$Pwd" | gzip -f9 --rsyncable > "$tar.tar.gz" && \
Back to my reason for wanting to tweak the menu entries - the ability of some compression programs for threadability.
gzip and bzip2 have no threadability. (At least the version shipped with Porteus do not) xz, 7za and zstd have threadability.
Cave! When tweaking the setting into using all available cores and you compress a large folder (as in: huge data) it could slow down your running system during compression.
__________________________________________
E.g. xz : -T [n] or --thread=[NUM] with 0 being auto maximum
Better not use the -T 0 option with xz.
When you have a 4 core, set -T 2 or -T 3, but not -T 0. When you mostly compress folders with small and few files, it would not matter.
But when you forgot you set the xz option to 0 = auto maximum - and then compress a folder with huge data - your system could appear to be frozen, and an unusable system, even only for half a minute, is often less desirable than having to wait a bit longer for the mc folder compression to be finished.
To be on the safe side of things, when you have a 4 core CPU system, you could tweak the mc user menu into using 3 cores for folder compression using xz by changing the original line from /etc/mc/mc.menu from
Code: Select all
tar cf - "$Pwd" | xz -f > "$tar.tar.xz" && \
Code: Select all
tar cf - "$Pwd" | xz -f -T 3 > "$tar.tar.xz" && \
7za: -mmt[N] : set number of CPU threads
So, by this syntax the tweak should be this: change
Code: Select all
tar cf - "$Pwd" | 7za a -si "$tar.tar.7z" && \
Code: Select all
tar cf - "$Pwd" | 7za a -si -mmt3 "$tar.tar.7z" && \
zstd: -T# : spawns # compression threads (default: 1, 0==# cores)
Finally, by that syntax tweak should be this: change
Code: Select all
tar cf - "$Pwd" | zstd -f > "$tar.tar.zst" && \
Code: Select all
tar cf - "$Pwd" | zstd -f -T3 > "$tar.tar.zst" && \