store script bloats saved files?
store script bloats saved files?
- Subject: store script bloats saved files?
- From: has <email@hidden>
- Date: Mon, 4 Feb 2002 23:18:55 +0000
Hi,
Getting really annoyed at "store script" at the moment...
I've written a script that generates customised string-to-html converter
libraries. The main script contains some very large tables and a small
constructor function that builds the actual converter object. The user
calls the constructor function, a script object is initialised and its
properties are set by pulling selected values from the tables according to
user preferences and putting them into "from" and "to" lists; the finished
object is then returned to the user.
Here's the problem: the converter object weighs in at a couple hundred KB
when saved to disk; it should only be 20KB or so (since all it contains is
a find-and-replace routine and a couple of lists). For some reason, the
main script (~180KB on disk) is obviously being included in the stored
script as well.
I did some thorough thrashing to eliminate any data sharing that might be
going on between the tables and the lists in the converter object. No dice
there. Next I split the thing across two files, the first file holds all
the tables and list-assembling code, the second contains just the
constructor. The constructor script loads the table script into a temp
variable, uses it to build the converter object's conversion lists, then
deliberately flushes the variable before returning the converter object.
Now when I store the converter object to disk, it's under 20KB as it should
be. Frankly, however, this level of kludging is ugly as hell and really
bugs me silly.
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)? [Or
does AS just have it in for me personally because I occasionally slag off
some of its grottier aspects?;p]
Any comments and feedback much appreciated. Many thanks,
has