[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Fast text output from SAX?


fast text usability
Elliotte Rusty Harold wrote:

>What are you actually trying to do? Serialization is not normally the 
>concern here. Is the question how fast this stuff can be generated? 
>Or something else?
>  
>
Yes, the question is how fast this stuff - text XML - can be generated. 
I'm interested in XML interchange costs, which includes both the input 
and output processing overhead as well as the actual document size. In 
order to give a comparison that's as fair as possible I'm using SAX2 
parse event streams as the common base document representation, which 
also corresponds to actual usage - if you were using XBIS as the 
transport for an XML document representation between programs you'd 
generally do so by plugging in an encoder that takes the place of text 
serialization at the sending end and a decoder that takes the place of a 
parser at the receiving end.

SAX2 is actually not all that ideal for this purpose, from either the 
usability (as discussed in the past on this list) or the performance 
standpoints. In terms of performance, SAX2 avoids strings for actual 
character data content and comments, but still requires them for 
attribute values - this means that immutable String objects have to be 
created for each attribute accessed on the receiving end, when 
oftentimes a temporary reference (using a JDK 1.4 CharBuffer, for 
instance) is all that's really needed. Another unfortunate performance 
aspect of SAX2 is that the namespace processing often needs to be done 
twice - once by the parser, then again by the application in many cases 
since the prefix-URI connection will otherwise be lost (unless the 
application just ignores namespaces and works directly with qualified 
names). If the API were to use Namespace objects directly (as 
implemented by any of the document models) and report names as 
(Namespace, String) (or (Namespace, CharBuffer)) pairs it would help 
eliminate some extra processing.

Thoughts for SAX3, I suppose.

  - Dennis

-- 
Dennis M. Sosnoski
Enterprise Java, XML, and Web Services
Training and Consulting
http://www.sosnoski.com
Redmond, WA  425.885.7197



PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.