Closed Bug 247115 Opened 18 years ago Closed 17 years ago

Use upx --best in 7zip.bat to reduce installer size

Categories

(Firefox :: Installer, enhancement)

x86
Windows XP
enhancement
Not set
normal

Tracking

()

VERIFIED FIXED
Firefox 3

People

(Reporter: megabyte, Assigned: djcater+bugzilla)

References

()

Details

(Keywords: fixed1.8.1)

Attachments

(1 file)

I noticed that the line in 7zip.bat is "upx -9"  The optimal compression
settings for UPX are obtained with "upx --best" so this should be used instead
to obtain the smallest possible file size.
Blocks: 171082
Severity: normal → enhancement
Isn't --best just an alias for -9?
No.
Is this bug related to 55930 (Use UPX to dramatically reduce startup time.)?
No.
Assignee: bugs → nobody
QA Contact: bugzilla → installer
From 'man upx;'

COMPRESSION LEVELS & TUNING
       UPX offers ten different compression levels from -1 to -9, and --best.  The default compression level is -8 for files smaller than 512 kB, and -7 otherwise.

       ·   Compression levels 1, 2 and 3 are pretty fast.

       ·   Compression levels 4, 5 and 6 achieve a good time/ratio performance.

       ·   Compression levels 7, 8 and 9 favor compression ratio over speed.

       ·   Compression level --best may take a long time.

       Note that compression level --best can be somewhat slow for large files, but you definitely should use it when releasing a final version of your program.

       Since UPX 0.70 there is also an extra compression level --best which squeezes out even some more compression ratio. While it is usually fine to use this option with your favorite .com file it may take a long time to compress a multi-megabyte program. You have been warned.
I've just got some info for todays nightly builds:

http://tinderbox.mozilla.org/showlog.cgi?tree=Firefox&errorparser=windows&logfile=1136638920.10602.gz&buildtime=1136638920&buildname=WINNT%205.2%20pacifica%20Depend%20release&fulltext=1

WINNT 5.2 pacifica Depend release on 01/07 05:02:00

C:\builds\tinderbox\Fx-Trunk\WINNT_5.2_Depend\mozilla\dist\install\7zstage>cd ..\7z 

C:\builds\tinderbox\Fx-Trunk\WINNT_5.2_Depend\mozilla\dist\install\7z>upx -9 7zSD.sfx 
                     Ultimate Packer for eXecutables
         Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002
UPX 1.24w        Markus F.X.J. Oberhumer & Laszlo Molnar         Nov 7th 2002

        File size         Ratio      Format      Name
   --------------------   ------   -----------   -----------
     99840 ->     53248   53.33%    win32/pe     7zSD.sfx

Packed 1 file.



And the actual size of the exe downloaded from http://ftp.mozilla.org/pub/mozilla.org/firefox/nightly/2006-01-07-05-trunk/

$ ls --classify -l ./firefox-1.6a1.en-US.win32.installer.exe;
-rw-r--r--  1 djc users 5121919 Jan  7 17:27 ./firefox-1.6a1.en-US.win32.installer.exe



Same thing for Thunderbird:

http://tinderbox.mozilla.org/showlog.cgi?tree=Thunderbird&errorparser=windows&logfile=1136635320.11368.gz&buildtime=1136635320&buildname=WINNT%205.0%20patrocles%20Depend%20release&fulltext=1

WINNT 5.0 patrocles Depend release on 01/07 04:02:00

E:\builds\tinderbox\thunderbird-trunk\WINNT_5.0_Depend\mozilla\dist\install\7zstage>cd ..\7z 

E:\builds\tinderbox\thunderbird-trunk\WINNT_5.0_Depend\mozilla\dist\install\7z>upx -9 7zSD.sfx 
                     Ultimate Packer for eXecutables
         Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002
UPX 1.24w        Markus F.X.J. Oberhumer & Laszlo Molnar         Nov 7th 2002

        File size         Ratio      Format      Name
   --------------------   ------   -----------   -----------
     99840 ->     51200   51.28%    win32/pe     7zSD.sfx

Packed 1 file.



And the actual size of the exe downloaded from http://ftp.mozilla.org/pub/mozilla.org/thunderbird/nightly/2006-01-07-05-trunk/

$ ls --classify -l ./thunderbird-1.6a1.en-US.win32.installer.exe;
-rw-r--r--  1 djc users 6463137 Jan  7 17:35 ./thunderbird-1.6a1.en-US.win32.installer.exe



This is so we can see how much of an effect --best has over -9. Patch coming up.
Status: NEW → ASSIGNED
Attached patch Use upx --bestSplinter Review
$ cvs -d :pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot diff -R --unified=8 --show-c-function ./mozilla/ ./247115.patch;

This changes all 4 places in mozilla/ that use upx to use --best. It contains mail/ changes, but I don't think a separate bug is necessary.

Requesting review from chase@mozilla.org as it's a build process thing...

Not sure who can/should superreview this...
Assignee: nobody → DJCater
Attachment #207837 - Flags: superreview?
Attachment #207837 - Flags: review?(chase)
Attachment #207837 - Flags: superreview? → superreview?(benjamin)
Attachment #207837 - Flags: review?(chase) → review+
Attachment #207837 - Flags: superreview?(benjamin) → superreview+
Thanks, can someone check this in for me?
mozilla/browser/installer/windows/7zip.bat; new revision: 1.4;
mozilla/browser/locales/Makefile.in; new revision: 1.36;
mozilla/mail/installer/windows/7zip.bat; new revision: 1.4;
mozilla/mail/locales/Makefile.in; new revision: 1.35;
Status: ASSIGNED → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 3
Version: unspecified → Trunk
Firefox before: 5072795 bytes.
Firefox after:  4912255 bytes.
Change:         -160540 bytes.

Thunderbird before: 6422166 bytes.
Thunderbird after:  Waiting for Tinderbox.
Change:             Waiting for Tinderbox.
Status: RESOLVED → VERIFIED
(In reply to comment #10)
> Thunderbird before: 6422166 bytes.
> Thunderbird after:  Waiting for Tinderbox.
> Change:             Waiting for Tinderbox.
> 

Thunderbird before: 6422166 bytes.
Thunderbird after:  6211349 bytes.
Change:             -210817 bytes.
Shouldn't this change have affected nightly firefox-1.6a1.en-US.win32.installer.exe files?  The one in

http://ftp.mozilla.org/pub/mozilla.org/firefox/nightly/2006-01-18-06-trunk/

is not significantly smaller than the one in

http://ftp.mozilla.org/pub/mozilla.org/firefox/nightly/2006-01-15-06-trunk/

Am I missing something?
Comment on attachment 207837 [details] [diff] [review]
Use upx --best

This has been on the trunk for ages with no problems at all, and it reduced the download size by a few the amounts listed in comment 10 and comment 11. I know the installer is being redone for Firefox 2, and I don't know whether it features UPX or not, but this patch gives a better indication of the size saved due to the new installer work, and provides a fallback if it doesn't happen.
Attachment #207837 - Flags: approval-branch-1.8.1?
Comment on attachment 207837 [details] [diff] [review]
Use upx --best

benjamin: do we still need this on 1.8.1, given the new installer work?
Attachment #207837 - Flags: approval-branch-1.8.1? → approval-branch-1.8.1?(benjamin)
Comment on attachment 207837 [details] [diff] [review]
Use upx --best

Won't hurt, pending the new installer for which I haven't seen code yet.
Attachment #207837 - Flags: approval-branch-1.8.1?(benjamin) → approval-branch-1.8.1+
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9a1) Gecko/20060423 Minefield/3.0a1

Super, can someone check this in on the 1.8 branch please? I'll post some numbers shortly after.
Checked in on 1.8 branch, adding keyword.
Keywords: fixed1.8.1
UPX 2.00 has been released. 
Interesting thing regarding this bug entry would be

    * slightly better compression using the new NRV2E algorithm
    * new options for compression tuning (e.g. '--brute')

Might be worth giving it a try instead of 1.24 or 1.25.

Shaving a few bytes is always a good thing :)
You need to log in before you can comment on or make changes to this bug.