Skip to Content.
Sympa Menu

xom-interest - Re: [XOM-interest] StackOverflowError compiling XOM

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: cowwoc <cowwoc AT bbs.darktech.org>
  • Cc: xom-interest AT lists.ibiblio.org
  • Subject: Re: [XOM-interest] StackOverflowError compiling XOM
  • Date: Mon, 14 Jul 2008 06:10:17 -0700

cowwoc wrote:

There should definitely be a better way of mapping characters than dumping a whole slew of if statements into a method. Have you tried asking on the Java discussion forums?


There are such ways and I use them, but the goal is maximum efficiency at runtime, not working around compiler bugs. This is a real hot spot in XOM and some serious effort has gone into optimizing every last millisecond out of this. Check out my chapter in Beautiful Code for the details sometime.

The simple fact is that the most efficient way is table lookup (O(1)) based on carefully constructed switch statements with no holes. If it's legal code and a compiler can't handle it, then get a better compiler. I'm not going to slow XOM down to work around compiler bugs.

--
Elliotte Rusty Harold elharo AT metalab.unc.edu
Refactoring HTML Just Published!
http://www.amazon.com/exec/obidos/ISBN=0321503635/ref=nosim/cafeaulaitA




Archive powered by MHonArc 2.6.24.

Top of Page