Bug 158731

Summary: rpm packages don't use the maximum force for xz compression
Product: LibreOffice Reporter: Jérôme <jerome.bouat>
Component: InstallationAssignee: Not Assigned <libreoffice-bugs>
Status: UNCONFIRMED ---    
Severity: normal CC: cloph, ilmari.lauhakangas, stephane.guillou, xiscofauli
Priority: medium Keywords: needsDevAdvice
Version: 24.8.0.0 alpha0+   
Hardware: All   
OS: Linux (All)   
See Also: https://bugs.documentfoundation.org/show_bug.cgi?id=158732
Whiteboard:
Crash report or crash signature: Regression By:
Bug Depends on:    
Bug Blocks: 113358    

Description Jérôme 2023-12-16 11:53:02 UTC
From the daily build language pack LibreOfficeDev_24.8.0.0.alpha0_Linux_x86-64_rpm_langpack_de.tar.gz, 7z tells that the below rpm uses the xz compression method :
------------------------------
$ 7z l libreofficedev24.8-dict-de-24.8.0.0.alpha0-1.x86_64.rpm 
[...]
Path = libreofficedev24.8-dict-de-24.8.0.0.alpha0-1.x86_64.cpio.xz
Type = xz
Physical Size = 16392316
Method = LZMA2:20 SHA256
Streams = 1
Blocks = 28
------------------------------

Next, I extracted the content of this rpm package with the below command :
7z x libreofficedev24.8-dict-de-24.8.0.0.alpha0-1.x86_64.rpm

This extracts the below file :
libreofficedev24.8-dict-de-24.8.0.0.alpha0-1.x86_64.cpio

Next I compressed this cpio archive with xz using the minimum and maximum force :
------------------------------
$ xz -1 --stdout libreofficedev24.8-dict-de-24.8.0.0.alpha0-1.x86_64.cpio > d-1.xz
$ xz -9 --stdout libreofficedev24.8-dict-de-24.8.0.0.alpha0-1.x86_64.cpio > d-9.xz
------------------------------

Looking at the size of the files, it seems the rpm uses a low compression force of xz :
------------------------------
$ ls -lhS *
-rw-r--r-- 1 j j  82M déc.  16 03:39 libreofficedev24.8-dict-de-24.8.0.0.alpha0-1.x86_64.cpio
-rw-r--r-- 1 j j  16M déc.  16 03:39 libreofficedev24.8-dict-de-24.8.0.0.alpha0-1.x86_64.rpm
-rw-r--r-- 1 j j  16M déc.  16 12:06 d-1.xz
-rw-r--r-- 1 j j 3,8M déc.  16 12:05 d-9.xz
------------------------------

The memory requirement on GNU/Linux in order to use LibreOffice is at least 256MB but prefered 512MB :
https://www.libreoffice.org/get-help/system-requirements/#Linux

The man page of xz tells :
"decompressing a file created with xz -9 currently requires 65 MiB of memory".

So there is no limitation to use the maximum force ("-9") for xz compression inside rpm. 

Users would then be able to download rpm files faster. The servers would save storage and bandwidth. As this is a single compression for many downloads, the maximum compression force for xz would provide an overall benefit.
Comment 1 Stéphane Guillou (stragu) 2024-01-12 17:06:14 UTC
Thanks Jérôme.
Same as for bug 158732, waiting for input from Cloph or Xisco (or any other savvy packager) on how doable that is for our installers and if there's any reason we shouldn't.