builder slow with lots of elements
Bug #1075622 reported by
Anders Hammarquist
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
lxml |
Fix Released
|
Medium
|
scoder |
Bug Description
Python : sys.version_
lxml.etree : (2, 3, 2, 0)
libxml used : (2, 8, 0)
libxml compiled : (2, 7, 8)
libxslt used : (1, 1, 26)
libxslt compiled : (1, 1, 26)
builder/
Attached patch simply tries to add to the last child, and if that gives an IndexError we use the no-child path. This is much quicker, a test I did went from 30 minutes to 3 minutes.
/Anders
Changed in lxml: | |
milestone: | none → 3.1 |
To post a comment you must log in.
Yes, that makes sense. This was originally written for ET where len(elem) is O(1) because it's backed by a Python list.
Thanks!
https:/ /github. com/lxml/ lxml/commit/ f428ea38f242731 3bee3d27abcab8d adda2b5af1