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

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

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: P5 P5
    • None
    • 6u10
    • 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.

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

              Created:
              Updated:
              Imported:
              Indexed: