[OSM-dev] XAPI and other solutions
Oliver Tonnhofer
olt at omniscale.de
Thu Apr 28 15:11:36 BST 2011
On 28.04.2011, at 16:00, Martijn van Exel wrote:
> Interesting, this totally uproots my firm conviction that SAX parsing is always more time- and memory-efficient than tree/DOM-based parsing.
Sure. DOM based parser need to keep the whole tree in memory which doesn't work well with large XML files. SAX and other stream based parser (like iterparse for Python) do not keep any information in memory. Stream based parser require more work from the developer, you can't use XPath expressions for example. So DOM based parsing still makes sense for documents with a known size, but for OSM data SAX/iterparse is the way to go.
> The article is 6 years old, do the benchmarks still hold in your experience?
Yes, for iterparse is still faster than xml.sax for Python.
Regards,
Oliver
--
Oliver Tonnhofer | Omniscale GmbH & Co KG | http://omniscale.de
http://mapproxy.org | https://bitbucket.org/olt | @oltonn
More information about the dev
mailing list