[XOM-interest] StackOverflowError compiling XOM

Elliotte Harold elharo at metalab.unc.edu
Tue Jan 13 11:02:49 EST 2009


cowwoc wrote:

>     The next thing I would recommend optimizing is 
> "UnicodeUtil.decompose(int character)". It is a whopping 6934 lines of 
> code and is likely causing the most pain for compilers and obfuscators. 
> You could either break this method down into multiple methods (since 
> most of its execution is linear anyway) or replace the if-else 
> statements with a switch block to improve performance but then reducing 
> the method size is not as obvious.
> 

I've checked in an experimental fix for decompose that reduces the 
number of byte codes and LOCs in the method at the expense of an 
equivalent expansion of the string table. I'm not sure if this will work 
or not. I could still move to a switch statement, or table lookup.

>     There is a "FIXME must recurse this" beside it, so maybe you already 
> have ideas for breaking it down?

That's unrelated. The Unicode NFC algorithm requires something like 
decomposing characters repeatedly until they don't decompose any more (I 
forget exactly. It's been a while) and I need to look into that.

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