Stack file size

Lars Brehmer larsbrehmer at
Wed May 25 11:58:17 EDT 2005

This is probably only of interest if you are a Rev user without much  
coding expertise like myself and are working with stacks and  
standalones that contain thousands of actual Rev cards, instead of  
using a data base.  I assume there are users out there who like me  
are making apps using Rev only for things like music collections,  
contacts, personnel files, etc., or in my case foreign language  
vocabulary trainers.  My main  project right now is for Estonian  
vocabulary and, without going into linguistic details, the nature of  
the language makes the trainer very complex and very large.

When I need to make changes to the app, I open the Rev stacks in the  
package conents of the standalone in Rev and make the changes.  I  
noticed a long time ago that any time a stack is open in Rev and I  
just click and navigate around for a while without even making code  
or content changes, the Rev stack grows slightly in size, by bits and  
bytes.  Doing the same in the standalone causes no size increase. Not  
a problem until I need to make changes to hundreds or thousands of  
cards because I got a better idea from Rev-list, (or occaissionally  
on my own ;-)  The size of my application has been growing  
disproportionately  to the amount of content I have added, becoming  
bloated, so I decided to see how much file size the Rev IDE had added  
over the months.  My mainStack has 15 substacks, seven  of which  
together have about 4,500 cards.   I did the following experiment;

In the IDE I turned each of the seven substacks into main stacks. For  
each of them I made a new substack in the mainStack with the exact  
same backgrounds, graphics, objects, etc.  I then added the seven  
mainstacks to the distribution as mainStacks.  In each of them was a  
button that basically did the following:

create a card in my counterpart substack
copy the contents of my fields to it
copy my custom properties to it

In the standalone I executed the scripts in the seven stacks and then  
took them out of the contents folder of the app package.  Now  
mainstack was just as it was before the experiment, but whatever  
simply working in the IDE over the last few months had added to those  
7 substacks, was now gone.  Well, you can imagine what the result  
was.  The size of my mainStack dropped from 8.4 megs to 5.7 megs,  
even thoght on the surface it is exactly the same!  And it runs  
faster to boot!  Also, the standalone engine in Rev 2.5.1 is smaller  
than in Rev 2.x, so my application has gone from 12.2 megs to 8.   
Good news, because I had estimated that the final would be about 20  
megs, but now I think it will come in at about 12.

I guess my point is that when you working with a stack with lots of  
cards and you want to make changes, always make scripts for the  
changes in Rev, but then execute them in the standalone.  This avoids  
adding a lot of fat to your application.

I hope this helps some of you "non programmers" out there trying to  
make lean, efficient programs.



More information about the Use-livecode mailing list