According to lxml benchmark [1], deepcopying a tree in ElementTree is about 20 times slower than in lxml. Proposed patch optimizes deepcopying C implementation of ElementTree about 20 times. It is now 5% to 3 times faster than in lxml.
Updated patch correctly handles rare cases when different elements share the same attrib dict and when the same Element is occurred on different places in ElementTree (that is no longer a tree, but a directed graph).
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: