xom-interest AT lists.ibiblio.org
Subject: XOM API for Processing XML with Java
List archive
[XOM-interest] Re: DOMConverter performance regression
- From: Wolfgang Hoschek <whoschek AT lbl.gov>
- To: xom-interest AT lists.ibiblio.org
- Subject: [XOM-interest] Re: DOMConverter performance regression
- Date: Sat, 2 Oct 2004 10:40:22 -0700
> However the problem with this solution is that it adds another 4 bytes
> per element to XOM's memory footprint, and I don't think that's a price
> I'm willing to pay here. I'll see if I can fix the problem some other
> way that has less of a downside.
Most apps retreive not only the next child but from the same parent
element. You could therefore keep global (or thread-local) state
of lastParent and lastPosition. However, experiment would be needed
to see if the required synchronization or thread-local variable would
be expensive enough to make the optimization pointless.
Reverting to a recursive DOMConverter (as in version d25) doubles performance, so I'd suggest that as the best path forward.
This is much better than 10-20% and it does not increase memory footprint, and does not exhibit the subtle and nasty thread-safety problems that are quite likely to occur with position tracking in instance variables. Also, a ThreadLocal per parentnode would most likely be a memory and performance disaster.
Wolfgang.
-
[XOM-interest] Re: DOMConverter performance regression,
Wolfgang Hoschek, 10/02/2004
- Re: [XOM-interest] Re: DOMConverter performance regression, Elliotte Harold, 10/02/2004
Archive powered by MHonArc 2.6.24.