What's the best Python XML parser for handling large files efficiently? or How do you choose the righ

22 Replies, 1503 Views

For massive files, avoid DOM parsers entirely. SAX or iterparse are the way to go.

lxml is fast, but if you’re *really* tight on RAM, the built-in `xml.sax` might surprise you.

Also, `cElementTree` (if you’re on Python 2) is *chef’s kiss* for speed.

Messages In This Thread



Users browsing this thread: 1 Guest(s)