Skip to Content.
Sympa Menu

xom-interest - Re: [XOM-interest] Serializer performance patches

xom-interest AT lists.ibiblio.org

Subject: XOM API for Processing XML with Java

List archive

Chronological Thread  
  • From: Robert Koberg <rob AT koberg.com>
  • To: Elliotte Harold <elharo AT metalab.unc.edu>
  • Cc: xom-interest AT lists.ibiblio.org
  • Subject: Re: [XOM-interest] Serializer performance patches
  • Date: Wed, 29 Jun 2005 17:41:10 -0400

Is Wolfgang a committer for XOM?

If not, shouldn't he be?

Are there other commiters to XOM than ERH? (especially after the latest saxon post to his blog (which I agree with!))

best,
-Rob


Elliotte Harold wrote:
After investigating this further, I'm fairly convinced that the performance gain Wolfgang found is real, but I don't think my initial hypothesis as to where that came from is correct. The "slow path" is doing more than simply looking for characters that need to be escaped. It's also counting characters for purposes of line breaks and indents and so forth; and I think most of the speed gain in this proposal comes from avoiding that. The failing unit tests post-patch all seem to indicate places where the the fast path failed to update fields the slow path would have caught.

I've had a FastSerializer class in my pantry (experimental code I don't necessarily make public) for a while now, and it shows numbers on my system that are close to what this patch from Wolfgang provides; not quite as fast but within 20%, and definitely faster than the usual Serializer. FastSerializer is not a subclass of Serializer. It's a complete reimplementation that only does UTF-8 and provides no line breaking or indenting or other pretty-printing features. Possibly something like this needs to be published, but don't think it's a replacement for the standard Serializer class.

There is still about a 20% improvement from Wolfgang's work beyond what my own FastSerializer does. I'm not sure where that's coming from. I need to explore the differences between the two classes a little more to see what he may have done that I didn't.

However, whichever way we go, I don't think this patch can work with the existing Serializer. It breaks the pretty printing too badly. What it makes clear though is just how much pretty printing (even the possibility of it, whether you do it or not) costs in serialization time. It might be worth releasing a much simpler, non-configurable serializer.






Archive powered by MHonArc 2.6.24.

Top of Page