Re: [xml-dev] No XML Binaries? Buy Hardware

From
Elliotte Harold <>
To
derek denny-brown <>
Date
2007-02-23T19:49:08Z
ID
<>
Thread
Re: [xml-dev] No XML Binaries? Buy Hardware
derek denny-brown wrote:
> Noah comments remind me of a test I did a while back.  I had a toy
> object serializer that I was playing with and was doing some
> performance measurements.  I wish I had the code still, but I found
> that a surprisingly larger portion of the runtime was string compares.

String operations will eat you alive if you aren't careful. This is 
hardly unique to XML. There's a huge amount of naive string handling 
code out there in production today. Seems like every third Daily WTF 
involves strings, and I notice that a lot of my students intuitively 
turn to strings at the first hint of trouble. For instance, when I 
assign them the problem of calculating a hashCode for an object, quite a 
few of them are going to mash everything together in one big string and 
then call hashCode on it. Strings are just too attractive as a general 
purpose data type, I guess.

I suspect (though I haven't proven) that we may well be API limited on 
some APIs like SAX and XOM. I don't think we've hit the limits of parser 
performance yet, but I do think if we want another factor of two we're 
going to need to start designing the API for performance rather than 
convenience. I'm not at all convinced we actually need that extra factor 
of two, though.

-- 
Elliotte Rusty Harold  
Java I/O 2nd Edition Just Published!
http://www.cafeaulait.org/books/javaio2/
http://www.amazon.com/exec/obidos/ISBN=0596527500/ref=nosim/cafeaulaitA/