Skip to Content.
Sympa Menu

xom-interest - Re: [XOM-interest] Some minor issues

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 AT lists.ibiblio.org
  • Subject: Re: [XOM-interest] Some minor issues
  • Date: Sun, 05 Dec 2004 05:56:41 -0500

Wolfgang Hoschek wrote:


3) Verifier.checkPCDATA

FYI, there are still Unicode calculations (multiplications, etc) in decodeSurrogatePair that are entirely unnecessary. Actually the entire method is unnecessary. My fastest version is as follows (retaining semantics unchanged):


I see what you're getting at here, but I find it really hard to believe decodeSurrogatePair has any practical impact. This is only going to come up if the text contains characters from beyond the basic multilingual plane. Does Lawrence Berkeley Labs really do that much processing on Tengwar and Cirth? :-)

I suspect the speed-ups you see here are based on using charAt instead of toCharArray, not eliminating the extra operations in decodeSurrogatePair. This is the sort of thing that is very VM specific, and perhaps even document specific. The reason I'm using toCharArray here is that in my tests on both Linux and Mac OS X this was faster. I can easily believe this could have turned around again in Java 1.5 or some other variation.

--
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