How do you reduce Revolution's compiled program sizes?

Richard Gaskin ambassador at fourthworld.com
Wed Jul 9 03:20:00 EDT 2003


Antn at aol.com wrote:

> I notice that all programs compiled with Revolutions (even the simple "hello
> world" sample) are on the heavy side (at least 1.8 megs,) even after you
> minimize usage of the optional libraries.
> 
> Is it because Revolution packs the runtime libraries along with every compiled
> project like Visual Basic does?

Precisely, but with two advantages over VB:

- Rev has a much smaller runtime footprint.

- It's self-contained: no DLLs strewn all over the hard drive conflicting
with other versions.


> I prefer Revolution to VB or C++ because it appears to be much easier to learn
> and use (not to mention it's cross platform feature), however, I am envious of
> the compactness of C++.
> 
> Why is C++ so small as compared to Revolution?

A multi-platform framework as complete as what Rev delivers will not be
radically smaller than Rev.  To facillitate platform-independence any good
frame work will have at least two layers: the platform-independent API you
write to, which in turn uses OS-specific calls to execute your code on a
given machine.

The Rev engine is written in C++, and if you look at it as a precompiled
library its actually rather compact for what it does, from flexible fast
text processing to QuickTime playback.

The biggest difference is that with C++ you're generally only compiling the
parts you need.  With isolated demo examples like "Hello World" the
difference can be quite substantial as you've noted, but once you start
building professional-level apps the size of your app is not out of line
with modern norms:

 - GraphicConverter   4.4 MB
 - Apple's DVD Player 7.7 MB
 - Address Book       2.1 MB
 - Apple's Calculator   1 MB
 - iCal              26.4 MB
 - iSynch            10.2 MB
 - Interarchy         4.1 MB
 - Photoshop           53 MB

My Rev-based WebMerge product does a lot of heavy text processing and FTP in
an attractive UI for just 2.1 MBs, less than one-fourth the size of Apple's
Cocoa-based iSynch utility.

> Another program that is cross-platform like Revolution, but extremely compact
> is Rebol. (http://www.rebol.com) The avg prog size for rebol is only about 5k
> (as opposed to 1800K for Revolution.) How did they manage to make Rebol so
> compact?

5k is so unusually small that I'm not sure how much could be accomplished
with that.  Not that Rebol isn't a flexible, robust system, as many seem
very enthused by its capabilities.  I'm just not certain a 5k runtime is
what drives it; my hunch is that, like C++, the more capabilities your app
has the larger the libraries needed to support it.
 
> Other than reducing the associated libraries, avoiding media files (graphics,
> audio, video, etc.,) what tricks and tips can be used to make Revolution
> produce leaner and trimer executables?

There's a feature request to consider breaking the engine into chunks to
allow smaller executables, but that's a non-trivial task and I've yet to
hear a commitment to such a plan.

In the meantime, most of the apps worth shipping will likely have enough
features to warrant the engine overhead.  Stack files themselves are very
small, so once you get past the engine size your app can be loaded with
features with relatively little additional overhead.

-- 
 Richard Gaskin 
 Fourth World Media Corporation
 Developer of WebMerge 2.2: Publish any database on any site
 ___________________________________________________________
 Ambassador at FourthWorld.com       http://www.FourthWorld.com
 Tel: 323-225-3717                       AIM: FourthWorldInc




More information about the use-livecode mailing list