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

Greg Stein gstein@lyra.org
Mon, 15 May 2000 17:53:55 -0700 (PDT)


On Mon, 15 May 2000, Anthony Baxter wrote:
> Once you've built an XML document in memory, what's the fastest
> way to get it to disk, and then re-read it in again afterwards?
> 
> cPickle is appallingly slow, and generates _huge_ output.
> 
> toxml() and then parsing it in again is also quite slow.
> I would have thought ESIS would be fast to read in, but nope. EsisBuilder
> seems to take (based on a number of runs) something like 40-50 times as
> long as utils.FileReader()
> 
> so, what do other folks use?

xml.utils.qp_xml parses XML into a very lightweight structure. Those
should be easily pickle-able. With a little bit of work, I bet they could
be marshalled.

It definitely isn't a solution out of the box, but (IMO) it is a great
head start on a Pythonic structure that is easily marshalled/pickled.

Cheers,
-g

-- 
Greg Stein, http://www.lyra.org/