include: use libdeflate's gzip to decompress

libdeflate decompresses much faster than gzip.

Example:

~/d/openwrt> time gzip -dc dl/cmake-3.25.1.tar.gz > /dev/null

________________________________________________________
Executed in    1.01 secs      fish           external
   usr time  912.61 millis    1.67 millis  910.94 millis
   sys time   32.21 millis    0.25 millis   31.96 millis

~/d/openwrt> time libdeflate-gzip -dc dl/cmake-3.25.1.tar.gz > /dev/null

________________________________________________________
Executed in  523.04 millis    fish           external
   usr time  415.48 millis    1.07 millis  414.41 millis
   sys time  107.74 millis    0.15 millis  107.59 millis

~/d/openwrt> time gzip -dc dl/tessdata-4.1.0.tar.gz > /dev/null

________________________________________________________
Executed in    8.99 secs    fish           external
   usr time    8.90 secs  530.00 micros    8.90 secs
   sys time    0.07 secs   63.00 micros    0.07 secs

~/d/openwrt> time libdeflate-gzip -dc dl/tessdata-4.1.0.tar.gz > /dev/null

________________________________________________________
Executed in    2.74 secs    fish           external
   usr time    2.38 secs  537.00 micros    2.38 secs
   sys time    0.35 secs   66.00 micros    0.35 secs

Place libdeflate into tools-core as it is needed to decompress other
archives.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
This commit is contained in:
Rosen Penev 2023-01-07 00:18:34 -08:00 committed by Christian Marangi
parent 62e150949f
commit 11ad0c8355
No known key found for this signature in database
GPG Key ID: AC001D09ADBFEAD7
2 changed files with 3 additions and 3 deletions

View File

@ -21,7 +21,7 @@ Kernel/Patch:=$(Kernel/Patch/Default)
ifneq (,$(findstring .xz,$(LINUX_SOURCE)))
LINUX_CAT:=xzcat
else
LINUX_CAT:=gzip -dc
LINUX_CAT:=$(STAGING_DIR_HOST)/bin/libdeflate-gzip -dc
endif
ifeq ($(strip $(CONFIG_EXTERNAL_KERNEL_TREE)),"")

View File

@ -18,7 +18,7 @@ ifeq ($(strip $(UNPACK_CMD)),)
ifeq ($(filter gz tgz,$(EXT)),$(EXT))
EXT:=$(call ext,$(PKG_SOURCE:.$(EXT)=))
DECOMPRESS_CMD:=gzip -dc $(DL_DIR)/$(PKG_SOURCE) |
DECOMPRESS_CMD:=$(STAGING_DIR_HOST)/bin/libdeflate-gzip -dc $(DL_DIR)/$(PKG_SOURCE) |
endif
ifeq ($(filter bzip2 bz2 bz tbz2 tbz,$(EXT)),$(EXT))
EXT:=$(call ext,$(PKG_SOURCE:.$(EXT)=))
@ -56,7 +56,7 @@ ifeq ($(strip $(UNPACK_CMD)),)
endif
# replace zcat with $(ZCAT), because some system don't support it properly
ifeq ($(PKG_CAT),zcat)
UNPACK_CMD=gzip -dc $(DL_DIR)/$(PKG_SOURCE) | $(TAR_CMD)
UNPACK_CMD=$(STAGING_DIR_HOST)/bin/libdeflate-gzip -dc $(DL_DIR)/$(PKG_SOURCE) | $(TAR_CMD)
endif
endif
endif