Avoid 2-step lookup in sun.nio.cs charset providers

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Unresolved
    • Priority: P5
    • None
    • Affects Version/s: 6u10
    • Component/s: core-libs

      A DESCRIPTION OF THE REQUEST :
      By retrieving a Charset object from FastCharsetProvider or AbstractCharsetProvider via charsetForName(String name), the canonical name of the charset is first lookuped from alias->canonical map, and 2ndly lookuped from canonical->charset map.

      JUSTIFICATION :
      Directly mapping from alias name to Charset instance by only 1 map would perform better.
      Additionally is would save some memory.
      Comment copied from http://bugs.openjdk.java.net/show_bug.cgi?id=100095
      Description From UlfZibis 2009-07-23 22:36:04 PDT

      Created an attachment (id=117) [details]
      webrev including patch

      - Now FastCharsetProvider only has 1 HashMap 'cache' to lookup.
      - AbstractCharsetProvider was replaced by ExternalCharsetProvider, which now
      inherits from FastCharsetProvider.
      - A Reference object contains all needed names of a Charset to lookup and
      create it.

            Assignee:
            Unassigned
            Reporter:
            Nelson Dcosta (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Imported:
              Indexed: