Viewing the size of stack elements (AKA, where have all the bytes gone?)
Ben Rubinstein
benr_mc at cogapp.com
Tue May 23 13:33:57 EDT 2006
Has anybody developed a tool - and to what extent is this possible - for
viewing the size of objects in Rev stacks?
It would be dandy if the application browser could reveal this information in
a column. Do any of the alternative IDE or browsers (MetaCard, Constellation,
...) give access to information like this? Or has anybody developed a tool
that could report all this?
The kind of thing I'd like in an ideal world is something that would be able
to tell me the number of bytes in an (uncompressed, unencrypted) stack file
taken up by an object and then make it possible to drill down. So a stack
file consists of I guess a header which occupies some number of bytes, and a
number of stacks each of which occupy some number of bytes. Similarly the
size of a stack can presumably be broken down into a header, properties (inc
stack script), audioclips, videoclips, cards, and possibly groups? Each of
those values (apart from the header) can similarly be drilled down into.
Is there any available that would produce such a report, or the data for it?
If not, how difficult would it be? As far as I can tell, Transcript doesn't
expose much information: there is a "size" property, but according to the docs
it's only applicable to a few objects - and for stacks always returns "10000".
I can iterate over properties and discover their size; but for, say, a
field, I don't know whether how the text is stored differs according to eg how
much of it is styled, whether it contains unicode elements, etc. Also AFAICT,
there isn't even a way to iterate over the properties of an object (is this
right?) - 'the properties' according to the docs is not complete.
If Transcript doesn't expose the information, the alternative would be to
disassemble the file directly. I recall that the HyperCard file format was
pretty straightforward to figure out. I've not looked at the Rev format - is
it transparent or cryptic? Is there a published description anywhere? (Also,
does anyone know what RunRev's attitude is to poking around - are they
relaxed, or likely to reach for the DCMA?)
The origin of all this is that I'm preparing to move an app that's always been
monolithic to a splashscreen-standalone, self-updating one - and I'm trying to
see how an earth it got so big! This is an app that I've been updating and
refining for many years - it was actually the app that I purchased Metacard to
create, many years ago before Revolution had been released, when I needed to
move a primitive Hypercard version to Windows. So it's a big old thing,
there's a lot of history in it - and I think there's fat which can be
stripped. But I need some tools to go looking.
Any suggestions, pointers, tools, warnings, etc gratefully received.
Ben Rubinstein | Email: benr_mc at cogapp.com
Cognitive Applications Ltd | Phone: +44 (0)1273-821600
http://www.cogapp.com | Fax : +44 (0)1273-728866
More information about the use-livecode
mailing list