Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4972423

DOM should have an option to intern strings

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Not an Issue
    • Icon: P4 P4
    • 5.0
    • 1.3.0
    • xml
    • generic
    • windows_xp

      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

            joehw Joe Wang
            kkawagucsunw Kohsuke Kawaguchi (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: