Tests on fhs-2.3.pdf.gz
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Osamu Aoki wrote:
> Hi,
>
> On Sat, Jun 24, 2006 at 05:30:59PM +0200, Mario 'BitKoenig' Holbe wrote:
>> Preben Randhol <randhol@pvv.org> wrote:
>>> My point is that if I choose to install a doc packages I intend to use
>>> it frequently and would therefore like that it is user friendly rather
>>> than that one has squeezed some few kilobytes out by gzipping files. If
>> Agreed. Particularly since the saving isn't sooo big at all.
>> On my - of course, not representative - workstation an uncompressed
>> doc/ tree takes only about a third more space (and this includes all
>> the ChangeLogs, READMEs etc. shipped with each package).
>>
>> root@darkside:~# du -sh /usr/share/doc
>> 839M /usr/share/doc
>> root@darkside:~# cp -ia /usr/share/doc /var/tmp
>> root@darkside:~# cd /var/tmp/doc
>> root@darkside:/var/tmp/doc# find . -type f -name \*.gz -print0 | xargs -0 gzip -d
>> gzip: ./kernel-package/Rationale already exists; not overwritten
>> gzip: ./kernel-package/HOWTO-Linux-2.6-Woody already exists; not overwritten
>> gzip: ./gcc-4.1-base/.changelog.Debian.gz has 1 other link -- unchanged
>> gzip: ./gcc-4.1-base/changelog.Debian.gz has 1 other link -- unchanged
>> root@darkside:/var/tmp/doc# du -sh .
>> 1,3G .
>> root@darkside:/var/tmp/doc#
>
> Interesting stat. Let me follow-up. On my system "du -sh ." returned:
> total /usr 2.4G
> compressed /usr/share/doc 239M
> uncompressed /usr/share/doc 435M
>
> Although it looks like 40% saving in space, its overall impact is less
> than 10% shrink in size.
>
[snip]
>
> Since dh_compress does compression (except the copyright file, .html and
> .css files, and files that appear to be already compressed based on
> their extensions) per its manpage, why not treat PDF as "compressed"
> which I thought is the case. In this sense, we do not need policy
> change. Just minor change in code to realize what dh_compress claim to
> do.
>
> It is very slow to open over 1MB size PDF file even on a system with
> proper auto-ungzipping. So aside from pedantic policy argument, we
> should uncompress PDF.
>
> Osamu
>
> PS: I did not feel like using -X option now because debhelper default
> should be desired behaviour. But I may change my mind soon.
>
> Reference:
> root@dambo:/var/tmp2# find . -type f -name \*.pdf.gz -print0 | xargs -0 gzip -l
> compressed uncompressed ratio uncompressed_name
> 228023 510762 55.4% ./debian-policy/fhs/fhs-2.3.pdf
> 486418 682351 28.7% ./debian-policy/policy.pdf
> 318890 456439 30.1% ./debian/FAQ/debian-faq.en.pdf
> 124536 155443 19.9% ./shared-mime-info/shared-mime-info-spec.pdf
> 798976 1239893 35.6% ./Debian/reference/reference.en.pdf
> 692308 1063782 34.9% ./Debian/reference/reference.de.pdf
> 808949 1245798 35.1% ./Debian/reference/reference.es.pdf
[snip]
> 168530 181283 7.1% ./fcitx/fcitx3.pdf
> 2346394 3590496 34.7% ./ddd-doc/ddd.pdf
> 145928 250564 41.8% ./ddd-doc/ddd-themes.pdf
> 790846 1166650 32.2% ./harden-doc/securing-debian-howto.de.pdf
> 730825 1093197 33.2% ./harden-doc/securing-debian-howto.en.pdf
> 758996 1109269 31.6% ./harden-doc/securing-debian-howto.fr.pdf
> 50136586 67439000 25.7% (totals)
Thanks to Martin Wuertle for pointing out the pdftk package!
I took the highly compressible fhs-2.3.pdf and ran a few tests.
No commentary, just numbers here:
$ dir fhs-2.3.pdf.gz
- -rw-r--r-- 1 me me 228023 2006-06-25 06:14 fhs-2.3.pdf.gz
$ gunzip -v fhs-2.3.pdf.gz
fhs-2.3.pdf.gz: 55.4% -- replaced with fhs-2.3.pdf
$ dir fhs-2.3.pdf*
- -rw-r--r-- 1 me me 510762 2006-06-25 06:14 fhs-2.3.pdf
$ pdftk fhs-2.3.pdf output fhs-2.3.uncompr.pdf uncompress
$ dir fhs-2.3*.pdf*
- -rw-r--r-- 1 me me 510762 2006-06-25 06:14 fhs-2.3.pdf
- -rw-r--r-- 1 me me 2883196 2006-06-25 06:16 fhs-2.3.uncompr.pdf
$ gzip -v fhs-2.3.uncompr.pdf
fhs-2.3.uncompr.pdf: 88.7% -- replaced with fhs-2.3.uncompr.pdf.gz
me@haggis:~$ dir fhs-2.3*.pdf*
- -rw-r--r-- 1 me me 510762 2006-06-25 06:14 fhs-2.3.pdf
- -rw-r--r-- 1 me me 324732 2006-06-25 06:16 fhs-2.3.uncompr.pdf.gz
- --
Ron Johnson, Jr.
Jefferson LA USA
Is "common sense" really valid?
For example, it is "common sense" to white-power racists that
whites are superior to blacks, and that those with brown skins
are mud people.
However, that "common sense" is obviously wrong.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFEnnLgS9HxQb37XmcRAtEBAJwNmpSRDR5K6sJkcg17V5D7+M7DewCg4tON
gullYUwSc0oYBNfnhnARkQk=
=RDQa
-----END PGP SIGNATURE-----
Reply to: