diff mbox series

[1/2] package_rpm: use zstd's default compression level

Message ID 20241120150346.2279992-1-alex.kanavin@gmail.com
State New
Headers show
Series [1/2] package_rpm: use zstd's default compression level | expand

Commit Message

Alexander Kanavin Nov. 20, 2024, 3:03 p.m. UTC
From: Alexander Kanavin <alex@linutronix.de>

zstd uses 3 by default, while 19 is the highest and slowest.
It's not clear why 19 was picked to begin with, possibly
I copy-pasted it from rpm's examples without thinking:
https://git.yoctoproject.org/poky/commit/?h=master-next&id=4a4d5f78a6962dda5f63e9891825c80a8a87bf66

This brings significant speedups in rpm's compression step:
for example compressing webkitgtk takes 11s instead of 36s.

The rpm size increases from 175648k to 234860k. I think it's
a worthy default tradeoff.

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
---
 meta/classes-global/package_rpm.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Quentin Schulz Nov. 20, 2024, 3:20 p.m. UTC | #1
Hi Alex,

On 11/20/24 4:03 PM, Alexander Kanavin via lists.openembedded.org wrote:
> From: Alexander Kanavin <alex@linutronix.de>
> 
> zstd uses 3 by default, while 19 is the highest and slowest.
> It's not clear why 19 was picked to begin with, possibly
> I copy-pasted it from rpm's examples without thinking:
> https://git.yoctoproject.org/poky/commit/?h=master-next&id=4a4d5f78a6962dda5f63e9891825c80a8a87bf66
> 
> This brings significant speedups in rpm's compression step:
> for example compressing webkitgtk takes 11s instead of 36s.
> 
> The rpm size increases from 175648k to 234860k. I think it's
> a worthy default tradeoff.
> 
> Signed-off-by: Alexander Kanavin <alex@linutronix.de>
> ---
>   meta/classes-global/package_rpm.bbclass | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/meta/classes-global/package_rpm.bbclass b/meta/classes-global/package_rpm.bbclass
> index ddc4bf3a6a5..b2b7fafa177 100644
> --- a/meta/classes-global/package_rpm.bbclass
> +++ b/meta/classes-global/package_rpm.bbclass
> @@ -10,7 +10,7 @@ IMAGE_PKGTYPE ?= "rpm"
>   
>   RPM = "rpm"
>   RPMBUILD = "rpmbuild"
> -RPMBUILD_COMPMODE ?= "${@'w19T%d.zstdio' % int(d.getVar('ZSTD_THREADS'))}"
> +RPMBUILD_COMPMODE ?= "${@'w3T%d.zstdio' % int(d.getVar('ZSTD_THREADS'))}"
>   

Since we have a variable containing the compression level for ZSTD 
(ZSTD_COMPRESSION_LEVEL), should we use it? The downside is that it's 
prefixed with a dash, which would need to remove before using it (or 
update the variable to not contain it and add it where the variable is 
currently used.

Cheers,
Quentin
Alexander Kanavin Nov. 20, 2024, 3:25 p.m. UTC | #2
On Wed, 20 Nov 2024 at 16:20, Quentin Schulz <quentin.schulz@cherry.de> wrote:

> Since we have a variable containing the compression level for ZSTD
> (ZSTD_COMPRESSION_LEVEL), should we use it? The downside is that it's
> prefixed with a dash, which would need to remove before using it (or
> update the variable to not contain it and add it where the variable is
> currently used.

Sure. I can send a v2.

Alex
diff mbox series

Patch

diff --git a/meta/classes-global/package_rpm.bbclass b/meta/classes-global/package_rpm.bbclass
index ddc4bf3a6a5..b2b7fafa177 100644
--- a/meta/classes-global/package_rpm.bbclass
+++ b/meta/classes-global/package_rpm.bbclass
@@ -10,7 +10,7 @@  IMAGE_PKGTYPE ?= "rpm"
 
 RPM = "rpm"
 RPMBUILD = "rpmbuild"
-RPMBUILD_COMPMODE ?= "${@'w19T%d.zstdio' % int(d.getVar('ZSTD_THREADS'))}"
+RPMBUILD_COMPMODE ?= "${@'w3T%d.zstdio' % int(d.getVar('ZSTD_THREADS'))}"
 
 PKGWRITEDIRRPM = "${WORKDIR}/deploy-rpms"