[lxml-dev] [lxml][objectify] optimization questions

Stefan Behnel behnel_ml at gkec.informatik.tu-darmstadt.de
Tue Oct 24 00:23:54 CEST 2006


Hi again,

I rewrote the current recursive string printing implementation to use a real
iterator for attribute access, which also lead to much shorter code in _Attrib
(after a cleanup). This should remove the difference you see, although moving
towards the slower variant. However, if it worked, this means that the
elements are immediately garbage collected, which is the right thing to do
from a memory perspective.

Please test on your machine a) if the two code snippets still differ in
performance and b) if the new implementation resulted in any noticeable slow down.

If you feel ambitious, take a look at the benchmark directory and try to come
up with a new benchmark suite "bench_objectify.py". The benchmark framework
makes new benchmarks extremely easy to write and the four test XML trees
should be well suited for objectify already.

Thanks,
Stefan




More information about the lxml-dev mailing list