10-26-2024, 02:16 PM
(This post was last modified: 10-26-2024, 04:20 PM by JRace.
Edit Reason: addenda & tyop fixes
)
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.
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.