[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [xml-dev] DOM or SAX: Sense and Sensibility
On Wed, 7 Nov 2001, Bullard, Claude L (Len) wrote:
> A topic for the usual Friday introspection two days early:
>
> How often do you as experienced XML developers find people in your
> shop using DOM for work more appropriate to SAX? Have you asked them
> why and what do they say? What are the costs of picking the wrong
> API?
Conversely, how often do you find people using SAX when DOM would be more
appropriate?
In my shop, I use both styles frequently - but, believe it or not, DOM is
actually usually _MORE_ appropriate for the very large documents I process
because raw performance is more important than memory usage for my
systems. I can allocate more memory for caches (and this is a very cheap
solution since I can buy memory retail for less than $200 US per GByte
currently - I couldn't buy hard drives that cheap only 5 or 6 years ago),
but I can only make a CPU/disk run so fast. NOT reading/parsing and
rereading/reparsing relatively static XML documents gives me a huge
performance boost. In fact that is the major reason why I moved from SAX
based XSLT rendering to DOM based rendering for the vast majority of our
stuff.
--
Benjamin Franz
"Code as if whoever maintains your code is a violent
psychopath who knows where you live."
-- Nancy Lebovitz, the button lady