Ticket #4622: 0001-Use-all-cores-for-zstd-compression.patch

File 0001-Use-all-cores-for-zstd-compression.patch, 5.8 KB (added by curtis, 9 hours ago)
  • misc/ext.d/archive.sh

    From 589227e13abb99fbe23667203eace3c37b4d12a9 Mon Sep 17 00:00:00 2001
    From: Curtis Doty <Curtis@GreenKey.net>
    Date: Sun, 22 Dec 2024 21:33:22 +0000
    Subject: [PATCH] Use all cores for zstd compression
    
     - only slight size penalty
    ---
     misc/ext.d/archive.sh            | 8 ++++----
     misc/ext.d/text.sh.in            | 2 +-
     misc/mc.menu.in                  | 4 ++--
     src/editor/edit.c                | 2 +-
     src/vfs/extfs/helpers/iso9660.in | 2 +-
     src/vfs/extfs/helpers/lslR.in    | 2 +-
     src/vfs/extfs/helpers/mailfs.in  | 2 +-
     src/vfs/extfs/helpers/patchfs.in | 2 +-
     src/vfs/sfs/sfs.ini              | 4 ++--
     9 files changed, 14 insertions(+), 14 deletions(-)
    
    diff --git a/misc/ext.d/archive.sh b/misc/ext.d/archive.sh
    index 12beb0158..8c84f8862 100755
    a b do_view_action() { 
    3939        xz -dc "${MC_EXT_FILENAME}" 2>/dev/null 
    4040        ;; 
    4141    zst) 
    42         zstd -dc "${MC_EXT_FILENAME}" 2>/dev/null 
     42        pzstd -dc "${MC_EXT_FILENAME}" 2>/dev/null 
    4343        ;; 
    4444    tar) 
    4545        tar tvvf - < "${MC_EXT_FILENAME}" 
    do_view_action() { 
    7777            tar tvvf - 
    7878        ;; 
    7979    tar.zst|tzst) 
    80         zstd -dc "${MC_EXT_FILENAME}" 2>/dev/null | \ 
     80        pzstd -dc "${MC_EXT_FILENAME}" 2>/dev/null | \ 
    8181            tar tvvf - 
    8282        ;; 
    8383    tar.F) 
    do_view_action() { 
    130130            cpio -itv 2>/dev/null 
    131131        ;; 
    132132    cpio.zst) 
    133         zstd -dc "${MC_EXT_FILENAME}" | \ 
     133        pzstd -dc "${MC_EXT_FILENAME}" | \ 
    134134            cpio -itv 2>/dev/null 
    135135        ;; 
    136136    cpio) 
    do_open_action() { 
    195195        xz -dc "${MC_EXT_FILENAME}" | ${pager} 
    196196        ;; 
    197197    zst) 
    198         zstd -dc "${MC_EXT_FILENAME}" | ${pager} 
     198        pzstd -dc "${MC_EXT_FILENAME}" | ${pager} 
    199199        ;; 
    200200    par2) 
    201201        par2 r "${MC_EXT_FILENAME}" 
  • misc/ext.d/text.sh.in

    diff --git a/misc/ext.d/text.sh.in b/misc/ext.d/text.sh.in
    index 38d64c40e..fff0de8d8 100644
    a b get_unpacker() { 
    3838        unpacker="xz -dc" 
    3939        ;; 
    4040    man.zst) 
    41         unpacker="zstd -dc" 
     41        unpacker="pzstd -dc" 
    4242        ;; 
    4343    esac 
    4444    echo ${unpacker} 
  • misc/mc.menu.in

    diff --git a/misc/mc.menu.in b/misc/mc.menu.in
    index 9d37e378a..0f0d16c10 100644
    a b shell_patterns=0 
    9090        read tar 
    9191        [ "$tar"x = x ] && tar="$Pwd" 
    9292        cd .. && \ 
    93         tar cf - "$Pwd" | zstd -f > "$tar.tar.zst" && \ 
     93        tar cf - "$Pwd" | pzstd -f > "$tar.tar.zst" && \ 
    9494        echo "../$tar.tar.zst created." 
    9595 
    96968       Compress the current subdirectory (tar.lzo) 
    x Extract the contents of a compressed tar file 
    249249            *.tar.lzma) PRG="lzma -dc";; 
    250250            *.tar.lzo)  PRG="lzop -dc";; 
    251251            *.tar.xz)   PRG="xz -dc";; 
    252             *.tar.zst)  PRG="zstd -dc";; 
     252            *.tar.zst)  PRG="pzstd -dc";; 
    253253            *)          exit 1;; 
    254254        esac 
    255255        $PRG %f | tar xvf - 
  • src/editor/edit.c

    diff --git a/src/editor/edit.c b/src/editor/edit.c
    index 9ff1a1054..7961cc263 100644
    a b static const struct edit_filters 
    137137} all_filters[] = { 
    138138    /* *INDENT-OFF* */ 
    139139    { "xz -cd %s 2>&1", "xz > %s", ".xz"}, 
    140     { "zstd -cd %s 2>&1", "zstd > %s", ".zst"}, 
     140    { "pzstd -cd %s 2>&1", "pzstd > %s", ".zst"}, 
    141141    { "lz4 -cd %s 2>&1", "lz4 > %s", ".lz4" }, 
    142142    { "lzip -cd %s 2>&1", "lzip > %s", ".lz"}, 
    143143    { "lzma -cd %s 2>&1", "lzma > %s", ".lzma" }, 
  • src/vfs/extfs/helpers/iso9660.in

    diff --git a/src/vfs/extfs/helpers/iso9660.in b/src/vfs/extfs/helpers/iso9660.in
    index e5d41dafe..2d940b10a 100644
    a b mcisofs_list () ( 
    182182      *.lzma) MYCAT="lzma -dc";; 
    183183      *.lzo) MYCAT="lzop -dc";; 
    184184      *.xz)  MYCAT="xz -dc";; 
    185       *.zst) MYCAT="zstd -dc";; 
     185      *.zst) MYCAT="pzstd -dc";; 
    186186      *.bz2) MYCAT="bzip2 -dc";; 
    187187      *.gz)  MYCAT="gzip -dc";; 
    188188      *.z)   MYCAT="gzip -dc";; 
  • src/vfs/extfs/helpers/lslR.in

    diff --git a/src/vfs/extfs/helpers/lslR.in b/src/vfs/extfs/helpers/lslR.in
    index 52b0b6a18..9e745e4c6 100644
    a b case "$1" in 
    1717  *.lzma) MYCAT="lzma -dc";; 
    1818  *.lzo) MYCAT="lzop -dc";; 
    1919  *.xz)  MYCAT="xz -dc";; 
    20   *.zst) MYCAT="zstd -dc";; 
     20  *.zst) MYCAT="pzstd -dc";; 
    2121  *.bz2) MYCAT="bzip2 -dc";; 
    2222  *.gz)  MYCAT="gzip -dc";; 
    2323  *.z)   MYCAT="gzip -dc";; 
  • src/vfs/extfs/helpers/mailfs.in

    diff --git a/src/vfs/extfs/helpers/mailfs.in b/src/vfs/extfs/helpers/mailfs.in
    index 20cfae317..2d801894f 100644
    a b $lz4cat="lz4 -dc"; # unlz4 to stdout 
    1313$lzcat="lzma -dc";            # unlzma to stdout 
    1414$lzocat="lzop -dc";           # unlzo to stdout 
    1515$xzcat="xz -dc";              # unxz to stdout 
    16 $zstdcat="zstd -dc";          # unzstd to stdout 
     16$zstdcat="pzstd -dc";          # unzstd to stdout 
    1717$file="file";                 # "file" command 
    1818$TZ='GMT';                    # default timezone (for Date module) 
    1919 
  • src/vfs/extfs/helpers/patchfs.in

    diff --git a/src/vfs/extfs/helpers/patchfs.in b/src/vfs/extfs/helpers/patchfs.in
    index 59fdde1fc..b2a1f169b 100644
    a b my $lz4 = 'lz4'; 
    1919my $lzma = 'lzma'; 
    2020my $lzo  = 'lzop'; 
    2121my $xz   = 'xz'; 
    22 my $zstd = 'zstd'; 
     22my $zstd = 'pzstd'; 
    2323my $bzip = 'bzip2'; 
    2424my $gzip = 'gzip'; 
    2525my $fileutil = 'file -b'; 
  • src/vfs/sfs/sfs.ini

    diff --git a/src/vfs/sfs/sfs.ini b/src/vfs/sfs/sfs.ini
    index a7b059be0..021cd3a18 100644
    a b lzo/1 lzop < %1 > %3 
    2020ulzo/1  lzop -d < %1 > %3 
    2121xz/1    xz < %1 > %3 
    2222uxz/1   xz -d < %1 > %3 
    23 zst/1   zstd < %1 > %3 
    24 uzst/1  zstd -d < %1 > %3 
     23zst/1   pzstd < %1 > %3 
     24uzst/1  pzstd -d < %1 > %3 
    2525tar/1   tar cf %3 %1 
    2626tgz/1   tar czf %3 %1 
    2727uhtml/1 lynx -force_html -dump %1 > %3