Bitsum Community Forum

General Category => PECompact, PESuite, PEBundle, and other developer tools => Topic started by: Przemek on August 16, 2008, 08:15:39 AM

Title: Compression of PECompact 2.78 vs newer releases
Post by: Przemek on August 16, 2008, 08:15:39 AM
I've been using PECompact 2.78 for quite some time until I decided to upgrade to the latest version yesterday. However I was surprised to see that the compression ratio in the latest PECompact 2.92 is a lot worse. My uncompressed executable is 11 MB and PEC2.92 compresses it to 6.6 MB (40.88% ratio) while PEC2.78 compressed it to only 2.3 MB (78.92% ratio). Where is that huge difference coming from? I downloaded other releases after 2.78 and they all seem to have similar (worse) compression ratio. I only use '/Ri:No' commandline parameter.
Title: Re: Compression of PECompact 2.78 vs newer releases
Post by: Jeremy Collake on August 19, 2008, 11:47:07 AM
Thanks for the report. I apologize for the delay in response.

[ conjecture, guesses deleted ]

If you can send me a link to the uncompressed executable I can figure out what is going on for sure..

Thanks,
Jeremy
Title: Re: Compression of PECompact 2.78 vs newer releases
Post by: Przemek on September 13, 2008, 04:10:30 PM
Using this commandline parameter didn't help, so I've sent you the link to the executable in the private message. Thank you for your time!
Title: Re: Compression of PECompact 2.78 vs newer releases
Post by: Jeremy Collake on September 16, 2008, 03:56:29 PM
It looks like this is due to the newer version of PECompact preserving the debug information (for later use with minidumps and such). The debug information in this executable is quite large and stored in the overlay/extra-data area.

I am correcting the behavior of /StripDebug:Yes for modules like this.

In the meantime, you can use PETrim on the executable first, to strip the debug information and the overlay completely. Then compress with PECompact.

Code: [Select]
PETrim.exe cafeagent.exe
PEC2.exe cafeagent.exe

Title: Re: Compression of PECompact 2.78 vs newer releases
Post by: Jeremy Collake on September 17, 2008, 04:18:34 PM
This should be fixed now, with the latest build being v2.94 final. The problem was two part:

1. Improper handling of debug directories generated by non-Microsoft linkers, causing inability to strip or relocate.
2. Change in default behavior of extra-data/overlays (where the debug data was kept in this exe).

I addressed both issues completely and properly in v2.94, removing the overlay only if, after stripping, it contains nothing else. In the case of your executable, after the debug directory is stripped, the overlay is indeed empty and is also removed. If you choose to preserve debug information, the debug data is relocated into the last section of the executable and the overlay removed.
Title: Re: Compression of PECompact 2.78 vs newer releases
Post by: Przemek on September 30, 2008, 01:22:03 PM
Thanks a lot Jeremy! Your support is really outstanding.