PDA

View Full Version : Compress Compiled Code?



Raveen Ryan Sundram
27-Sep-2005, 08:06 PM
DAW,

I find that the compiled VDF programs are huge - my smallest program is
about 3MB to 4MB in size.
Is there a way to compile smaller EXEs? Or a fast & dirty way would be to
compress the EXE and expand it at runtime - like the famous PKLITE.

Just a thought

Raveen

Anders Íhrt
28-Sep-2005, 02:32 AM
> I find that the compiled VDF programs are huge - my smallest program is
> about 3MB to 4MB in size.

VDF .exe's are huge, I agree. But, what is the problem really? For me it's
the time it takes to send this over a slowish WAN/VPN, so I always zip them,
but once it's there I don't see a point really. Both disk and memory is
cheap enough to not care about a couple of MB's of loose.


> Is there a way to compile smaller EXEs? Or a fast & dirty way would be to
> compress the EXE and expand it at runtime - like the famous PKLITE.

Since the .exe's appear to be in the standard format, you could try the .exe
packers that are out there. Google a bit, you should find them easily.

// Anders

Jim Albright
28-Sep-2005, 10:16 AM
I am using upx to compress my .exe. A 9mb program compresses to 1.7 mb.

http://upx.sourceforge.net/

Jim
"Raveen Ryan Sundram" <raveen@xls.co.nz> wrote in message
news:o$rGjj8wFHA.3904@dacmail.dataaccess.com...
> DAW,
>
> I find that the compiled VDF programs are huge - my smallest program is about 3MB to 4MB in size.
> Is there a way to compile smaller EXEs? Or a fast & dirty way would be to compress the EXE and
> expand it at runtime - like the famous PKLITE.
>
> Just a thought
>
> Raveen
>

Dave &/or Wempy
28-Sep-2005, 01:58 PM
Can I ask, for delivery over a WAN or just to speed up program opening
on a slow LAN?

Dave



On Wed, 28 Sep 2005 11:16:31 -0400, "Jim Albright"
<jalbright@cfl.rr.com> wrote:

>I am using upx to compress my .exe. A 9mb program compresses to 1.7 mb.
>
>http://upx.sourceforge.net/
>
>Jim
>"Raveen Ryan Sundram" <raveen@xls.co.nz> wrote in message
>news:o$rGjj8wFHA.3904@dacmail.dataaccess.com...
>> DAW,
>>
>> I find that the compiled VDF programs are huge - my smallest program is about 3MB to 4MB in size.
>> Is there a way to compile smaller EXEs? Or a fast & dirty way would be to compress the EXE and
>> expand it at runtime - like the famous PKLITE.
>>
>> Just a thought
>>
>> Raveen
>>
>

Raveen Ryan Sundram
28-Sep-2005, 08:53 PM
Anders,

The bigger the file the longer it takes to load - especially over networks.
And plus, the bigger the file the more resources are required - try
optimising Terminal Services for an application with a program file of 8MB
for 50 users!

With the computer industry going back to centralised deployment, programs
need to be streamlined and slick.

Size does matter!

Raveen


"Anders Íhrt" <Anders.Ohrt@capslock.se> wrote in message
news:p2L7M7$wFHA.2208@dacmail.dataaccess.com...
>
>> I find that the compiled VDF programs are huge - my smallest program is
>> about 3MB to 4MB in size.
>
> VDF .exe's are huge, I agree. But, what is the problem really? For me it's
> the time it takes to send this over a slowish WAN/VPN, so I always zip
> them, but once it's there I don't see a point really. Both disk and memory
> is cheap enough to not care about a couple of MB's of loose.
>
>
>> Is there a way to compile smaller EXEs? Or a fast & dirty way would be to
>> compress the EXE and expand it at runtime - like the famous PKLITE.
>
> Since the .exe's appear to be in the standard format, you could try the
> .exe packers that are out there. Google a bit, you should find them
> easily.
>
> // Anders
>

Raveen Ryan Sundram
28-Sep-2005, 09:16 PM
Jim,

This is quite good - the loading time is definitely faster but it does use
more RAM than the original EXE.
I guess it matter of preference - Speed or RAM

Test Scenerio:

A VDF10 EXE compressed from 4,337,664 => 992,256 (22.88%)
Memory Usage on executing compressed file: 4,354,048 [16,384 (0.38%)
increase]

A WEBAPP EXE compressed from 1,032,192 => 267,776 (25.94%)
Memory Usage on executing compressed file: 1,044,480 [12,288 (1.19%)
increase]

Raveen.

Anders Íhrt
29-Sep-2005, 01:56 AM
> The bigger the file the longer it takes to load - especially over
> networks.

Upgrade the network. =)

On a good network (switched 100Mbps), you shouldn't notice.


> And plus, the bigger the file the more resources are required - try
> optimising Terminal Services for an application with a program file of 8MB
> for 50 users!

Well, we do have 200+ users on out citrix farm, and our applications are
between 4 and 10MB. This is no problem. You might be able to save 100MB, but
with 50 users you should have about 2GB, so it's not _that_ big an issue.


> Size does matter!

Of course, but everything must be weighed against the effort.

// Anders

Anders Íhrt
29-Sep-2005, 01:57 AM
> This is quite good - the loading time is definitely faster but it does use
> more RAM than the original EXE.

If probably decompresses the exe to the original size, while takes a bit of
memory.

// Anders

Jim Albright
29-Sep-2005, 10:02 AM
Dave,

We are using it over a 100BaseT LAN. A batch file on the server delivers the app to the w/s and
then starts it. The w/s only has a link to the batch file on the server. The batch file will always
load the latest published version of the program. I don't have to wait for users to exit the program
in order to publish a new version. The batch file copies the compress version of the program and the
program decompresses itself automatically. It cut the time to start a 9 mb program from about 14
seconds to about 3 seconds! The users don't see anything different other that it is faster now.

Jim

"Dave &/or Wempy" <it@kirkfreeport.net> wrote in message
news:psplj1hsvl50rric9ors850cugf1n7dkp7@4ax.com...
> Can I ask, for delivery over a WAN or just to speed up program opening
> on a slow LAN?
>
> Dave
>
>
>
> On Wed, 28 Sep 2005 11:16:31 -0400, "Jim Albright"
> <jalbright@cfl.rr.com> wrote:
>
>>I am using upx to compress my .exe. A 9mb program compresses to 1.7 mb.
>>
>>http://upx.sourceforge.net/
>>
>>Jim
>>"Raveen Ryan Sundram" <raveen@xls.co.nz> wrote in message
>>news:o$rGjj8wFHA.3904@dacmail.dataaccess.com...
>>> DAW,
>>>
>>> I find that the compiled VDF programs are huge - my smallest program is about 3MB to 4MB in
>>> size.
>>> Is there a way to compile smaller EXEs? Or a fast & dirty way would be to compress the EXE and
>>> expand it at runtime - like the famous PKLITE.
>>>
>>> Just a thought
>>>
>>> Raveen
>>>
>>