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: Wolfgang Hoschek <whoschek AT lbl.gov>
  • 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 08:48:05 -0700

On Jun 29, 2005, at 4:36 AM, Elliotte Harold wrote:

Wolfgang Hoschek wrote:


private final boolean isUnicodeWriter = this instanceof UnicodeWriter; // WH


I think we could avoid all the instanceof checks by instead overriding some of these methods in UnicodeWriter. That's a lot cleaner and more obvious. I'd need to definalize some methods, but this is all internal, package-protected stuff so that's no big deal. That would also completely eliminate any possible performance impact on non-Unicode encodings since they would then use exactly the same code they're using now.


It would be a more invasive change, so I didn't try, but I suspect it might be somewhat counterproductive. One "if" to handle [isUnicodeUtil] easier than than N virtual "iffs" [virtual method dispatch w/ "abstract"].
What perhaps might (or might not) work is to define the Unicode behaviour in the default impl in TextWriter, rather than declaring them "abstract". I formulated the code in a way that's known to work well.

Wolfgang.




Archive powered by MHonArc 2.6.24.

Top of Page