Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Making files more portable
#10
UPX is a great tool that I use all the time on Windows.

Executable compression has its pros & cons, which you will find people talking about online if you do a bit of Googling.

Speaking practically, EXE compression is a space/speed trade-off.

I used to UPX-compress almost all of the EXEs & DLLs in compiler suites.  Not quite all, because some EXEs  & DLLs don't work when compressed.

I don't do that any more.  UPX can decompress and run files fairly quickly, but that decompression still takes time, and compilers like MinGW (the "backend" of QB64PE) & CLang are made up of many executables calling each other, loading DLLs, etc.  That adds up to a lot of decompression time during every compile.  Compressing every file in a compiler suite REALLY slows down the compiler.  You MAY (or may not) actually see some speed benefit by compressing EXEs on a slow thumbdrive, but not on a hard drive.  Do this on a hard drive or SSD only if you are desperately short on space.

(Fun fact: 7z.exe runs just fine when UPX-compressed, but if you use the UPX -decompress option to restore 7z.exe to its "original" form, that restored 7z.exe will no longer work.)

(Back in the Win98 daze I compressed just about every executable in my Win98 installation.  Ooopsie!  That's a surefire way to get Windows stuck in a bluescreen boot loop.  That quickly led to a Win98 REinstallation!)

Also, tightly compressed files don't archive well.  An archive of pre-compressed files is often larger than an archive of large, uncompressed files.

These days I just leave the hardworking compiler EXEs alone and have Windows automagically compress my desktop box's programming folder, which transparently compresses everything in the folder & subfolders right down to all those header and library files, which can add up to a lot of space.  This is all handled by the operating system and is invisible to the user.

This file-system level compression is an optional feature on all of the major operating systems.  It is not on by default.

It's still a space/speed trade-off, but it's one that I and my overstuffed hard drive can live with.
Reply


Messages In This Thread
Making files more portable - by JRace - 10-21-2024, 12:40 AM
RE: Making files more portable - by SMcNeill - 10-21-2024, 11:22 AM
RE: Making files more portable - by Dav - 10-21-2024, 01:14 PM
RE: Making files more portable - by JRace - 10-21-2024, 04:46 PM
RE: Making files more portable - by SMcNeill - 10-21-2024, 05:14 PM
RE: Making files more portable - by JRace - 10-21-2024, 05:29 PM
RE: Making files more portable - by grymmjack - 10-24-2024, 07:32 AM
RE: Making files more portable - by bplus - 10-24-2024, 02:07 PM
RE: Making files more portable - by euklides - 10-25-2024, 01:37 PM
RE: Making files more portable - by JRace - 10-26-2024, 02:16 PM



Users browsing this thread: 1 Guest(s)