dev@fi.java.net

String interning and symbol table

From: Kohsuke Kawaguchi <Kohsuke.Kawaguchi_at_Sun.COM>
Date: Wed, 05 Jan 2005 11:12:28 -0800

> Note that an FI parser implementation will always return the same
> instance of an identifying string (if implemented sensibly, difficult
> to avoid this!) it is just not interned with respect to the JVM.

.NET exposes a symbol table for applications. Those tables can be
pre-filled or shared across multiple parser instances, and presumably
all the strings are interned against this table.

 From an application's perspective, a parser that always return the same
string instance isn't too useful. Most of the times, we want to compare
the names against constant names we hard-coded in our program, and doing
that efficiently requires all the strings to be String.intern-ed.

This symbol table thing aside, it would really help (at least JAXB RI)
if the FI parser has a mode to intern strings. It can do it more
efficiently than applications do.

-- 
Kohsuke Kawaguchi
Sun Microsystems                   kohsuke.kawaguchi_at_sun.com
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe_at_fi.dev.java.net
For additional commands, e-mail: dev-help_at_fi.dev.java.net