Skip to Content.
Sympa Menu

xom-interest - Re: [XOM-interest] Cache misses in namespace URI verification

xom-interest AT lists.ibiblio.org

Subject: XOM API for Processing XML with Java

List archive

Chronological Thread  
  • From: Elliotte Harold <elharo AT metalab.unc.edu>
  • To: Wolfgang Hoschek <whoschek AT lbl.gov>
  • Cc: xom-interest <xom-interest AT lists.ibiblio.org>
  • Subject: Re: [XOM-interest] Cache misses in namespace URI verification
  • Date: Fri, 10 Dec 2004 15:28:43 -0500

OK, now I'm getting somewhere. If I test with XOMChecker, which just parses, instead of Reproducer, which copies, I don't see the cache misses. I also see a third as many total hits. And I think that's the clue I needed.

The cache misses aren't coming from the Builder at all. They're coming from the new elements created by Reproducer. And now that I look for that I see the problem. It's this line:

Element copy = new Element(original.getQualifiedName(),
new String(original.getNamespaceURI()));

What that call to a String constructor is doing there I don't know. But it would break the interning. Taking it out, the cache gets hit 100% of the time after each of the namespace URIs is seen once.

So it looks like we can indeed use == for the comparison here. OK. I'll make the changes in CVS. That's one mystery solved.

--
Elliotte Rusty Harold elharo AT metalab.unc.edu
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




Archive powered by MHonArc 2.6.24.

Top of Page