ElementTree is slow af for large files, no lie. Lxml is better, but if you’re *really* struggling, check out `defusedxml` for security + performance.
Also, pre-processing your XML (removing junk nodes) can help. Tools like `xmlstarlet` can clean things up before you even touch Python.
Just my 2 cents—hope it helps!
Also, pre-processing your XML (removing junk nodes) can help. Tools like `xmlstarlet` can clean things up before you even touch Python.
Just my 2 cents—hope it helps!
