[XOM-interest] StackOverflowError compiling XOM

Elliotte Harold elharo at metalab.unc.edu
Tue Jul 15 11:22:08 EDT 2008


cowwoc wrote:
> 
>     I've generated a replacement for UnicodeUtil.getCombiningClass() 
> that consists of 223 lines of code and runs approximately 20x faster 
> than the original code (which consists of 1143 lines of code). Please 
> see the attached file.
> 
>     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.
> 

Thanks. I'll look at these when I get a minute. I may have misspoken 
earlier, I was thinking of the Verifier XML name and text methods more 
than the UnicodeUtil methods you mention. Those particular methods are 
only used by the serializer, and only when certain uncommon options are 
chosen so they haven't been as heavily optimized as the methods that are 
invoked for every single element, attribute, and text construct. 
Possibly, here, I could take some performance hit in exchange for not 
pushing the compiler's buttons.  This is all non-public code used 
internally by XOM so we can be pretty aggressive about refactoring if it 
helps.


The recurse FIXME you mention is about a possible bug, not performance.

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