XML vs. cPickle
Mike
mike12mike12 at hotmail.com
Fri Jan 13 17:10:33 EST 2006
> I'd guess that XML serialisation with cElementTree is both cpu and
> memory competitive with cpickle, if not superior. Although I'm too lazy
> to fire up the timeit module right now :-)
That maybe true, but I bet Marshal is the fastest. ...right?
> Also, how quickly the relevant parsers work depends on the input, i.e.
> your data structures. Only you can take measurements with your data
> structures ....
True.
> > The idea is I want to store data that can be described as XML
> can != should
I certainly 'can', I don't think I should.
> > into my
> > database as cPickle objects. Except my web framework has no support for
> > BLOB datatype yet, and I might have to go with XML.
> Or you could encode the binary pickle in a text-safe encoding such as
> base64, and store the result in a text column. Although that will
> obviously increase your processing time, both going in and out of the
> database.
base64... (used to convert arbitrary binary data to plain text), sounds
fantastic. Except, I don't think I need it when marshaling anymore
since marshaling gives you clear text anyways. (right?)
> > Ideas are appreciated,
> I'd write a few simple prototypes and take some empirical measurements.
I am doing it now. Thanks,
Mike
More information about the Python-list
mailing list