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: 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] Some minor issues
  • Date: Sun, 5 Dec 2004 09:27:30 -0800


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? :-)

Who knows, a few years from now we might be communicating with aliens from hidden corners of the universe, using the highest planes. Assuming that they use a concept of symbols. Of course, it might not happen, perhaps they'll see our use of character encodings as a compatibility threat to some kind of holy fetish, in which case they might deem our "preventive destruction" a more practical avenue, leaving little room for negotiating a standard process. Just kidding :-)


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.

If there's a difference it stems from the use of a more or less optimizing compiler. I'm using JDK 1.5 server VM. Apps runnning a client VM in production presumably don't need or care about optimizations anyway.

Wolfgang.





Archive powered by MHonArc 2.6.24.

Top of Page