[Home] [By Thread] [By Date] [Recent Entries]


Elliotte Harold wrote:

> 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.

Microsoft is using this technique in .NET where a vocabulary is known a 
priori, e.g. in XSLT implementation - they eagerly preload all XSLT and 
XML keywords into a nametable at the beginning. Saxon is doing the same.

> 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.

At least .NET's XmlTextReader employs it - 
http://dotnet.di.unipi.it/Content/sscli/docs/doxygen/fx/bcl/xmltextreader_8cs-source.html, 
line 742 (that's sscli sources - officially it's not .NET sources, but 
frankly speaking they are almost always very-very close to .NET 1.0).

-- 
Oleg Tkachenko
http://blog.tkachenko.com
Multiconn Technologies, Israel

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member