lxml is a bit faster than ElementTree, but not by much, and it doesn't ship with Python. We could switch pretty easily by changing the ElementTree import to the following:
from lxml import etree as ElementTree
In my testing, switching led to a 10% speed up, but in practice that was only 2 seconds.
lxml
is a bit faster thanElementTree
, but not by much, and it doesn't ship with Python. We could switch pretty easily by changing theElementTree
import to the following:In my testing, switching led to a 10% speed up, but in practice that was only 2 seconds.