dev@jaxb.java.net

Re: String Interning

From: Kohsuke Kawaguchi <Kohsuke.Kawaguchi_at_Sun.COM>
Date: Mon, 02 Jul 2007 10:25:17 +0900

Matthias Ernst wrote:
> Hi,
>
> in a low-level benchmark with JAXB, XmlInterningVisitor turned up. Why
> exactly are interned symbols required?

Originally we've been doing a lot of string comparisons, so interning
was thought to help performance. Since then, a lot of things have
changed and this actually no longer makes much sense.

So I think it makes sense to stop doing it ---it's more like legacy
optimization, rather than premature optimization.

However, most parsers do the string interning already, and typically
JAXB can take advantage of the fact and avoids extra interning. So I'm
curious how you are calling JAXB.

> To try, I patched UnmarshallerImpl to not require interning and +
> QNameMap to do .equals-comparsion. Result: 190000 unmarshalled objects
> per second instead of 100000.

I wonder if you'd be interested in contributing the patch. If so, we'd
like you to get signed up for SCA to cover the legal side.

>
> So Interning cost almost 50% performance in my case.
>
> Do you have other results? Was interning a premature optimization?
>
> Cheers
> Matthias
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe_at_jaxb.dev.java.net
> For additional commands, e-mail: dev-help_at_jaxb.dev.java.net
>
>


-- 
Kohsuke Kawaguchi
Sun Microsystems                   kohsuke.kawaguchi_at_sun.com