[XOM-interest] StackOverflowError compiling XOM

Elliotte Harold elharo at metalab.unc.edu
Mon Jul 14 09:10:17 EDT 2008


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


More information about the XOM-interest mailing list