Richard Jones' Log: cElementTree released!

Tue, 11 Jan 2005

I use ElementTree a lot, for reading, creating and manipulating XML files. It's the only XML tool I use (for HTML, I use BeautifulSoup). And now it's faster. A lot faster:

    library                     memory  time
    ------------------------------------------------------------
    minidom (python 2.1)        80000k  6.5s
    minidom (python 2.4)        53000k  1.4s
    ElementTree 1.3             14500k  1.1s
    pyRXPU                      11500k  0.22s
    cElementTree 0.8             5700k  0.058s
    ------------------------------------------------------------
    readlines (read as text)     5050k  0.032s
    ------------------------------------------------------------

That's pretty damned cool :)

The only minor annoyance with ElementTree is that there's no downloadable docs. Sadly it doesn't offer pydoc much information either. Makes it hard for me to code on the train.

Update: /F has informed me that more recent ElementTree downloads have the docs bundled (we're still running 1.1, having not even tested upgrading to 1.2 yet - just been remedied :)

Comment by Fredrik on Tue, 11 Jan 2005

"no downloadable docs"

Recent versions of elementtree comes with HTML documentation in the docs subdirectory. (For earlier versions, just run PythonDoc on the elementtree package directory, and you're done.)

(I'm still trying to figure out a good way to make pydoc use pythondoc markup, without having to patch Python...)

Cheers /F

Comment by mark on Thu, 13 Jan 2005

Hello,

I read your blog via Planet Python and an RSS reader and there must be something wrong with your RSS feed because your posts appear in nearly every new batch of news items. I'm getting a bit fed up of hearing that element tree has been released (or that you made a PDF calendar)