axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Aleksander Slominski <as...@cs.indiana.edu>
Subject Re: Why Pull-Parser faster ? - Still NO answer
Date Fri, 21 Feb 2003 02:10:07 GMT
Ricky Ho wrote:

> Just between SAX and XPP ....
>
> If SAX can be stopped anytime by throwing an exception, this means the 
> application can control when to stop.  And if XPP is not skipping 
> whitespace ...
>
> Why XPP is faster than SAX ?? 

hi,

not sure if these two can be compared. SAX is just an API with many 
implementations. XPP2 is also API (with two implementations) and XmlPull 
API has 3 implementations (and XPP3 is one of them). even if you run 
some tests (like 
http://www.extreme.indiana.edu/~aslom/xpp_sax2bench/results.html) how it 
will work for you will ultimately depend on implementation used, 
hardware and software environment (OS, memory, CPU, version of Java), 
your application and on what XML input you are processing.

however i guess your question is if there is something in XML push or 
pull parsing (SAX or XmlPull  are just examples of such APIs) that would 
make one faster than another? i think that both APIs have similar 
performance capabilities and choice to use push or pull parsing should 
be dictated by you need to use streaming parsing (if you do not want 
streaming than maybe some DOM-like API is better) and how your 
application is processing XML.

i would say that for if you need to do filtering and/or use state 
machines then push parsing code is easier and when you need to convert 
XML to other representation pull parsing code is more natural IMHO - i 
have discussed some of those issues and some others in this technical 
report: http://www.extreme.indiana.edu/xgws/papers/xml_push_pull/  where 
i makes point that  pull and push are actually complementary approaches 
and can be used *together* even on the same input (it describes XPP2 API 
but most of it applies to XmlPull API as well).

hope you find it useful in addressing your concerns.

thanks,

alek

-- 
"Mr. Pauli, we in the audience are all agreed that your theory is crazy. 
What divides us is whether it is crazy enough to be true." Niels H. D. Bohr



Mime
View raw message