[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [xml-dev] DOM or SAX: Sense and Sensibility
> NOT reading/parsing and rereading/reparsing relatively static
> XML documents gives me a huge performance boost.
I was under impression that it should usually give
about 10-15% boost. Is that 'huge' ?
Well, maybe I don't understand something...
> 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.
XSLT rendering is not 'SAX based'. It is 'OM-based'.
XSLT keeps the entire document in the memory. Well,
there are some XSLT engines that try to do something
smarter, ( like SAXON's 'preview' ) but I don't think
that using 'preview' gives any 'speed boost' . In the cases it
*does*, that means that the document is anyway
too huge to be processed by DOM at all.
In the case when 10-15% of speedup is what
you're looking for, something like Chunks [1]
or other Brutal XML bindings [2] should
outperform DOM significantly.
My prediction is that the era of low-level
lexer ( called SAX ) and low-level model
( called DOM) is over and there will be
soon more high-level bindings on top
of these low-level APIs (or not on top of them).
I think that asking developers to write all the code
in terms of SAX or DOM APIs is like asking
them to write programms in assembly language.
Rgds.Paul.
[1] http://www.pault.com/pault/pxml/nxml.html
[2] Here are two other Brutal XML Bindings
http://web.co.nz/~grantm/cpan/index.html
http://www.zope.org/Members/haqa/XMLKit
I appreciate more URLs for brital XML bindings,
seems not easy to find them ...