Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Pascal Misc > Re: Saving prog...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 5 of 9 Topic 746 of 806
Post > Topic >>

Re: Saving program state in executable

by Marco van de Voort <marcov@[EMAIL PROTECTED] > Jun 17, 2007 at 04:56 PM

On 2007-06-17, Peter Brooks <Peter.H.M.Brooks@[EMAIL PROTECTED]
> wrote:
> The reason is connected to my other question here. If you load lots of
> UML or OWL data using XML's DOM model, it takes quite a while to load
> and fills a fair amount of system memory. To speed things up, it would
> be good to have two stages, first run the program to read in and
> initialise its state from a bit XML file, then, after that, simply
> swap it in from file space ready loaded.

From this story I make up the following:

- The state that you want to store is mostly one or a few trees.
- The overhead is mostly the textprocessing and parsing of the XML models.

Then the solution is easily: Write something that can binary stream the
related structures to disc, and then reload them. (e.g. check first if the
input XMLs are modified, if not, load the cache).

Maybe the units you use to load the XML already have a common ancestor
that
you could enhance or plug to make this happen.

> I know that this could be done with the data contained in a pascal
> 'const' record, or set of records, at compile time, and that might be
> the final solution, but, to my mind, that's a bit messy. I might do it
> that way, if I can't find a better solution - you'd run an
> 'initialise' program that would write source code including the XML
> file that you need included, then compile that, which would be the
> program that you would run. Fast and small as the fpc compiler is,
> though, if I'm going to be having hundreds, or thousands, of such
> programs, it'll be something of an overhead - it would be nicer to
> have the programs initialise themselves.

This is a dead end. You can blockwrite a single record because the
compiler
knows it is one block of memory (assuming it doesn't contain e.g.
dynamically allocated strings). However you can't do this for entire
datastructures that are criss-cross allocated in memory.

> I know that this would be an easier job using python or php, but
> that's the point, I want to avoid repeated interpretive effort to get
> a good response time, recompiling repeatedly would, on balance, leave
> me back in the same sort of world as java, python or php.

While absolutely true, that comes at a cost. Which means you have skilled
progrmaming to do to make that happen.
 




 9 Posts in Topic:
Saving program state in executable
Peter Brooks <Peter.H.  2007-06-16 20:33:55 
Re: Saving program state in executable
CBFalconer <cbfalconer  2007-06-16 20:18:03 
Re: Saving program state in executable
"Chris Burrows"  2007-06-17 11:47:18 
Re: Saving program state in executable
Peter Brooks <Peter.H.  2007-06-16 20:37:14 
Re: Saving program state in executable
Marco van de Voort <ma  2007-06-17 16:56:37 
Re: Saving program state in executable
Peter Brooks <Peter.H.  2007-06-16 20:58:03 
Re: Saving program state in executable
Marco van de Voort <ma  2007-06-17 10:57:22 
Re: Saving program state in executable
CBFalconer <cbfalconer  2007-06-17 09:37:47 
Re: Saving program state in executable
Marco van de Voort <ma  2007-06-17 16:57:50 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sun Jul 6 6:02:38 CDT 2008.