Many applications/technologies that use XML needs to do a lot of string comparisons.
For example, a typical application would look at a tag name and if it's "foo", it does this,
and if it's bar, it does that, and so on. One common technique to improve performance
of such applications/technologies is to use String.intern().
This allows string comparisons to be reduced to the == operator, which is much faster than
String.equals().
Furthermore, most of the parsers (such as Xerces and Crimson) already does the interning,
so in reality, most of the times, when you call the getLocalName() or getNamespaceURI() method,
the string you get is interned().
If a feature is defined for DOM so that one can set/query whether all names are interned,
applications can rely on this to improve the performance.
See SAX's string-interning feature for the equivalent in SAX.
###@###.### 2003-12-23
For example, a typical application would look at a tag name and if it's "foo", it does this,
and if it's bar, it does that, and so on. One common technique to improve performance
of such applications/technologies is to use String.intern().
This allows string comparisons to be reduced to the == operator, which is much faster than
String.equals().
Furthermore, most of the parsers (such as Xerces and Crimson) already does the interning,
so in reality, most of the times, when you call the getLocalName() or getNamespaceURI() method,
the string you get is interned().
If a feature is defined for DOM so that one can set/query whether all names are interned,
applications can rely on this to improve the performance.
See SAX's string-interning feature for the equivalent in SAX.
###@###.### 2003-12-23