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

Re: Re: Hostility to "binary XML"


richard tobin mac
Richard Tobin wrote:


> I think that if you really wanted to, you could get 99% of this speed
> up anyway.  Don't check the characters, check the name against the
> DTD, and then only if it isn't declared check the characters and
> then fake a declaration so it will be quick next time.

I actually implemented something very much like this just this morning 
in XOM, only for namespace URIs rather than element and attribute names. 
I just store the four most recently seen namespace URIs in a cache, and 
search the cache before verifying that a string is a correct namespace 
URI. It basically dropped the time XOM spends verifying namespace URIs 
to zero.

I wonder if a similar scheme would help with verifying element names? 
Namespace names repeat a lot more commonly than element/attribute names, 
and there are fewer of them to search through. Still, in most documents 
names do repeat fairly frequently. Even if caching element names proved 
troublesome, attribute names are more commonly repeated, and namespace 
prefixes are very commonly repeated. You could cache these to avoid 
reverification.

I'm curious. Have any parser implementers built a dynamic cache of 
preverified names? Did it help any? Even if it in the general case it 
proves to be no faster than repeatedly checking the same names, it might 
still be useful to preload a cache of especially common names before 
parsing a lot of documents. For instance if you know you're going to be 
parsing SOAP, then you could load up all the common SOAP element names.

Another possible optimization: you don't need to verify end-tags, just 
check that it matches the start-tag, which you have to do anyway. I'm 
almost certain some, perhaps most or all, parsers are doing this already.

-- 
Elliotte Rusty Harold  elharo@m...
XML in a Nutshell 3rd Edition Just Published!
http://www.cafeconleche.org/books/xian3/
http://www.amazon.com/exec/obidos/ISBN=0596007647/cafeaulaitA/ref=nosim

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.