ANN: cElementTree 0.9.8 (january 23, 2005)
Fredrik Lundh
fredrik at pythonware.com
Sun Jan 23 10:29:38 EST 2005
effbot.org proudly presents release 0.9.8 of the cElementTree library,
a fast and very efficient implementation of the ElementTree API, for
Python 2.1 and later. On typical documents, it's 15-20 times faster
than the Python version of ElementTree, and uses 2-5 times less
memory.
Here are some benchmark figures, using a number of popular XML tool-
kits to parse a 3405k document-style XML file from disk:
library memory time
------------------------------------------------------------
amara 20300k 6.4s
minidom (python 2.4) 53000k 1.4s
ElementTree 1.2.4 14500k 1.1s
cDomlette 20500k 0.54s
pyRXPU 10850k 0.175s
libxml2 16000k 0.098s
cElementTree 0.9 4900k 0.047s
------------------------------------------------------------
readlines (read as utf-8) 8850k 0.093s
readlines (read as ascii) 5050k 0.032s
------------------------------------------------------------
This release also includes a new "iterparse" mechanism, which can be
used to process the tree as it is being built. While not quite as
fast as a full parse, it's over 4 times faster than Python's standard
SAX interface, and even a bit faster than sgmlop.
The library is available as C source code, and as Windows installers
for all recent Python versions. Get your copy here:
http://effbot.org/downloads#celementtree
The cElementTree module uses some support functions from the standard
ElementTree library, and will not work properly without it. If you
haven't installed it already, you can get it from:
http://effbot.org/downloads#elementtree
enjoy /F
"effbot.org -- not knowing how Python is used since 1995"
More information about the Python-list
mailing list