logo       
Google Custom Search
    AddThis Social Bookmark Button
-->

Re: nscleanup branch merged: better namespace handling in lxml: msg#00061

Subject: Re: nscleanup branch merged: better namespace handling in lxml
Hi again,

Stefan Behnel wrote:
> I finally found the time to take a second look back at the nscleanup branch.
> [...]
> I also expect it to be faster than the previous version -
> although I haven't done the benchmarks yet to prove it.

I did some now. It looks like most benchmarks for objectify get faster
compared to 1.2, between 5% and 30% on my machine. That's because objectify
suffers a lot from document merging, as assigning elements to other element's
attributes does exactly that. Note that 1.2 is somewhat slower than 1.1.2 in a
couple of places. In total, the new version is more or less as fast as 1.1.2
was, sometimes faster, sometimes slower.

The etree benchmark results are less interesting. I just ran the document
merging benchmarks and there is not much of a difference to see here. The
results are all rather close across the three versions.

Another thing that surprised me: it doesn't seem to make that a big difference
if threading support is compiled in or not. Some benchmarks get faster if it
is disabled (meaning: no locking etc.), but most of them stay about the same.
So, this can make a difference in certain situations, but it's not enough to
consider disabling it by default or something.

While I was at it, I also added a few more checks for the migrated namespace
references. The redundant ones are now freed when moving elements between
documents. I can't tell if this was the case before (I believe they were just
kept on the copied element), but it definitely works now.

So, I'm quite happy with the results so far. There may still be some space
left for optimisations, but it's not too urgent as it seems. And namespace
handling definitely has much better semantics now.

Have fun,
Stefan


<Prev in Thread] Current Thread [Next in Thread>