[XML-SIG] fast dump/restore of an XML document?

Lars Marius Garshol larsga@garshol.priv.no
16 May 2000 14:08:31 +0200


* Lars Marius Garshol
|
| <URL: http://www.python.org/doc/current/lib/module-marshal.html >
| Marshal is, I think, much faster than pickle, so it's certainly worth
| a try. 

* Anthony Baxter
| 
| Only if it's not more expensive to convert it into a marshallable form.

Well, you can represent the XML document purely as lists, dictionaries
and tuples. With some access functions it's likely to be at least as
convenient as the DOM, although harder to learn for new comers.
 
* Lars Marius Garshol
|
| What I've been wondering is why you want to do this, though. Why not
| use some kind of database system with the possibility to export to
| and import from XML?
 
* Anthony Baxter
|
| speed - loading up a document with multiple megabytes of XML and
| thousands of nodes is horribly slow. Unfortunately, pickling them is
| even slower :/
| 
| I think I'm just going to have to build my own wierd structures and
| wrap a DOM or something on top of them.

You misunderstand the question. For some reason you seem to use XML as
the underlying data model for your data, rather than to load from XML
into some application-specific representation and dump from that
representation and back out.

Why not use a relational database for these data? Or ZODB? Or Metakit?
Or application-specific classes with shelve and/or pickle? Why XML?

--Lars M.