Re: store script bloats saved files?
Re: store script bloats saved files?
- Subject: Re: store script bloats saved files?
- From: Malcolm Fitzgerald <email@hidden>
- Date: Wed, 24 Apr 2002 23:41:49 +1000
I've just dug back to Feb to find and revive this thread because I
was experiencing this problem. I've been using Smile to test and
store the script objects and they have been getting big. I started to
get memory errors and table overflows that prevented me from storing
the scripts, even though it was possible to compile the scripts.
These scripts were much larger than the original code. It seemed odd
that several of the script libraries that I had downloaded from
MacScripters were small, though the code was comparable in length to
mine. I decided to open up Script Editor and see what sort of size it
produced when it stored script objects. Here are the results
(finder's size on disk)
stored script stored script
Name text Smile Script Editor
FileLib (Serge) 12K 788K 28K
PrefsLib 20K 324K 16K
AstidLib 24K 244K 16K
WebLib 44K 364K 32K
WodaLib 56K 388K 128K <-- bigger
because it calls in all above
in fact, I've just noticed that saving the code as text from Script
Editor produces a much smaller version of the text file too. In the
case of WebLib it went from 40K (44K on disk) down to 7K (12K on
disk).
This on an late 2001 iBook running
AppleScript version -- "Z1-1.6"
CarbonLib -- 1.4
MacOS -- 9.2.1
Script Editor -- Z1 - 1.6
Smile -- 1.8.4
At 23:18 +0000 UTC, on 04-02-2002, has wrote:
[...]
> It looks to me like store script stores not just the script object it's
being told to store, but also a *complete copy* of the script that spawned
it! This is quite a pain if the creator script is a quarter MB in size
(compiled), and is grossly inefficient and/or overkill.
Anyone else found the same behaviour, and/or ways to avoid it if they have?
Is it a sign of clumsy data sharing in action, or something else? Has it
been changed/fixed in newer versions of AS (I'm on 1.3.7 under OS8.6)?
I happened to be playing with the same sort of thing just a few days ago and
I noticed the same behaviour. (Under Mac OS 9.2.1 btw.)
What might play a role here is how the spawned script is created. What I do
is I have the main script (an applet) make a copy of itself, then have it
store a script object into that copy, overriding what was there. Perhaps a
bit of a 'dirty' way to create a script, and this size issue may be the
price; "store script" seemingly doesn't really wipe the original data in the
object. (If so, besides size, also security/privacy may be an issue in some
situations.)
Would be interesting to know why this happens the way it does. Would be even
better to know an elegant way to avoid it, or even just a way around it :)
--
--
Malcolm Fitzgerald email@hidden
Database Manager
http://www.asauthors.org
The Australian Society of Authors ph: 02 93180877 fax: 02 93180530
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.