Tiny Core Base > TCB Tips & Tricks

advdef ver.2.1 versus 7z ver.26

(1/3) > >>

nick65go:
I tried but I can not reproduce the rootfs.gz of TC17 32 bits. I use an OS 64 bits. advdef (of TC17-64bits) gave me a bigger than original size,  but 7z (from x86-64-v3) gave me a smaller size than original size. gzip parameters (-1 until -9) did not help me with TC advdef.
It means that latest 7zip version 26 has a better Deflate64 encoder than for Advdef (still using deflate64 - as wikipedia said).
--- Code: ---> sudo find | sudo cpio -o -H newc | sudo gzip -1 > ../456.gz
18182 blocks

> ./advdef -z4 456.gz
     4230967     3701889  87% 456.gz
     4230967     3701889  87%

--- End code ---

--- Code: ---> sudo find | sudo cpio -o -H newc | sudo gzip -9 > ../456.gz
18182 blocks
> ./advdef -z4 456.gz
     3846705     3701889  96% 456.gz
     3846705     3701889  96%

> ./advdef -V
advancecomp v2.1 by Andrea Mazzoleni, http://www.advancemame.it
--- End code ---

--- Code: ---> sudo find | sudo cpio -o -H newc ../123.cpio

> 7z a -tgzip -mx9 123.gz 123.cpio

7-Zip 26.00 (x64) : Copyright (c) 1999-2026 Igor Pavlov : 2026-02-12
 64-bit locale=en_US.UTF-8 Threads:12 OPEN_MAX:1024, ASM

Scanning the drive:
1 file, 9309184 bytes (9091 KiB)
Creating archive: 123.gz
Add new data to archive: 1 file, 9309184 bytes (9091 KiB)
Files read from disk: 1
Archive size: 3684655 bytes (3599 KiB)
Everything is Ok
--- End code ---


--- Code: ---> ls -alB
drwxr-xr-x          - abc 13 Mär 12:18  .
drwxr-xr-x@         - abc 13 Mär 12:12  ..
drwxr-xr-x          - abc 13 Mär 12:10  tmp
.rw-r--r--  9.309.184 abc 13 Mär 10:49  123.cpio
.rw-r--r--  3.684.655 abc 13 Mär 11:55  123.gz
.rw-r--r--  3.701.889 abc 13 Mär 12:18  456.gz
.rwxr-xr-x     97.456 abc  3 Nov  2018 󰡯 advdef
.rw-r--r--  3.697.459 abc  8 Mär 15:22  rootfs.gz
--- End code ---

Paul_123:
Advdef and gzip are single threaded programs.  Not sure what 7zip is doing but I use pigz, and you can definitely smash gzip and advdef files smaller by throwing multiple threads iterating on it.   But its a case of how much CPU power do you want to throw at it.

You examples above are less than 1% difference in size.  Its just for storage anyway, the initrd is going to be decompressed at boot anyway.

nick65go:
@Paul_123 thanks for the info. Could you please post your similar results for rootfs.gz of TC17 32 bits, using pigz (or what ever compress better than 7zip) ?

1. My first complain is that I can NOT reproduce original TC work / size, which does not look good for me; but hey I am minority concerned by reproducibility of software ...

2. My (temporary) goal is to obtain MINIMM size for a rootfs.gz, to boot in a less than 64MB RAM (unfortunately I do not trust KolibryOS). Deftate structure allows ANY encoding algorithm (even DEFLATE64 form 7zip, Advcomp/advdef etc) and then using ANY compatible zlib/ gzip decoder (Wikipedia citation). So as long as compression is one time only (to create the rootfs.gz) and has (near) the SAME speed to decode many times, the tool did not matter, just the result. 
PS: from https://documentation.help/7-Zip/method.htm , i did not use switch -mmt12 (aka Sets multithreading mode), but maybe there were some defaults in 7z. I tried later with no improvement even with large page (-slp : set Large Pages mode), etc..

Paul_123:
The rootfs is decompressed into RAM, so the size on the disk is not important.

Reproducing compression is nearly impossible….even though it is lossless.

nick65go:

--- Quote from: Paul_123 on March 13, 2026, 08:42:19 AM ---The rootfs is decompressed into RAM, so the size on the disk is not important.
Reproducing compression is nearly impossible….even though it is lossless.

--- End quote ---
1. Really? this is "disturbing", that using same original compression program offered by TC and the same input original TC data, for a single-threaded advdef you said I can not obtain the same result.

2. The decompressed size in RAM is/must/should be the same because is LossLESS algorithm, but size on disk/ storage matters also (a little?) because is the boot-loader speed to read+load rootfs.gz in memory FROM HDD/USB/CDROM. YMMV, same as your goal.

FYI: I do not intend to be pedantic/annoying, but for me the small RAM request is high priority versus CPU speed. Like with a slow CPU but enough RAM I wait 10 minute (exaggerate!) but run and solve the task/problem. Vice-versa, with fast CPU but not enough RAM I can not run, so is useless as a stealth nomad in wild environment.

Navigation

[0] Message Index

[#] Next page

Go to full version