[jdom-interest] Presences of Namespace dramatically slows SAXBuilder

Jason Hunter jhunter at acm.org
Tue Apr 3 18:10:23 PDT 2001


Good point.  Just fixed the javadoc.

-jh-

Ken Klose wrote:
> 
> Jason,
> 
> Thanks for the speedy reply.  I "primed the pump" as you mentioned and saw
> results similar to yours.  Another question though, the Javadoc (from
> Beta-6) says that Element.getAdditionalNamespaces returns null if there are
> no additional namespaces.  Doesn't this put your solution at risk for a
> NullPointerException?
> 
> Thanks,
> Ken
> 
> -----Original Message-----
> From: Jason Hunter [mailto:jhunter at acm.org]
> Sent: Tuesday, April 03, 2001 3:52 PM
> To: Ken Klose
> Cc: 'jdom-interest at jdom.org'
> Subject: Re: [jdom-interest] Presences of Namespace dramatically slows
> SAXBuilder
> 
> On the SAX side: Priming alone didn't bring the SAX build in line, so I
> did a little OptimizeIt testing and found that one line was taking the
> vast bulk of time:
> 
>   availableNamespaces.remove(element.getAdditionalNamespaces());
> 
> I changed it to:
> 
>   List addl = element.getAdditionalNamespaces();
>   if (addl.size() > 0) {
>       availableNamespaces.remove(addl);
>   }
> 
> And now what did take 13219ms now takes 580ms (on Xerces).  Quite a
> change, and right in line with the no-NS build that takes 470ms.  I'll
> be checking in the enhancement after this.
> 
> Thanks, Ken, for bringing this to my attention.
> 
> -jh-



More information about the jdom-interest mailing list