[lxml-dev] [objectify] optimization issues
Stefan Behnel
behnel_ml at gkec.informatik.tu-darmstadt.de
Mon Oct 9 19:21:04 CEST 2006
Hi Holger,
first of all: please create a new thread for a new topic instead of responding
to an existing message. Most mail client honour the "in reply to" hint in the
header and sort them into the old thread.
Then: what you observe are most likely GC 'issues'. The thing is: if the
element already exists as Python object, it is reused, which is much faster
then creating a new one. So in the cases where your code runs faster, you can
assume that the object survived a larger portion of your code without being
re-instantiated.
Especially recursive printing instantiates the entire tree, so if the objects
are not deleted directly afterwards, this has a performance effect on code
that runs afterwards.
Stefan
More information about the lxml-dev
mailing list