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

(cs) Charset.isSupported is slow when invoked for different charsets

    Details

    • Subcomponent:
    • Introduced In Build:
      1.4.1
    • Introduced In Version:
    • Resolved In Build:
      b01
    • CPU:
      generic, x86
    • OS:
      windows_xp

      Backports

        Description

        The performance becomes too slow when isSupported runs for several charsets.

        The isSupported might not be used directly by java users.
        However, it is called when OutputStreamWriter or Reader is constructed.
        (which is, "new" operation applies to them)

        Those Stream classes is well-used and charset switch will well-occurs
        in 2 bytes locale environment.
        So, the performance deterioration is too big.


        REPRODUCE :
          (1) Compile the attached program
          (2) Launch "java isSupportedTest"
             ==> You will see the list in following "BEHAVIOR" .

        BEHAVIOR:
           
          The test program is lauching isSupported as follows.
            case1: to warm up compiled code and
                   invoke isSupported "ISO-8859-1"
            case2: to warm up compiled code and
                   invoke isSupported "UTF-8"
            case3: to invoke isSupported "ISO-8859-1" and "UTF-8"

        The performance in case3 is worse than the others.
        Please see below. Unit is mili second.

        =======
        K:\nio-perf\isSupport>java isSupportedTest
        case1:60
        case2:70
        case3:6099

        K:\nio-perf\isSupport>java -version
        java version "1.4.2_03"
        Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_03-b02)
        Java HotSpot(TM) Client VM (build 1.4.2_03-b02, mixed mode)

        =======

        CONFIGURATION :
          OS : windowsXP (SP1, Japanese)
          JRE : 1.4.2_03
          


        ================================================================================

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  martin Martin Buchholz
                  Reporter:
                  tbaba Tadayuki Baba (Inactive)
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  2 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Imported:
                    Indexed: