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

RFE: optimization in EUC_JP code converter

XMLWordPrintable

    • hopper
    • generic
    • generic
    • Verified

      There are some room to optimize the EUC_JP code converters (Byte to Char).

        - Handle ASCII characters in convert() to avoid the convSingleByte() call overhead.

        - Look up byte1 in the order of the general priority
          (i.e., JIS X 0208, JIS X 0201:GR, JIS X 0212)

        - Eliminate unnecessary masking with 0xff

      The revised ByteToCharEUC_JP.java is in Attachment. It gives 12% better performance (CPU time) with ASCII only data and 18% better with ASCII+Kanji data with the String(byte[]) constructor.

      Probably similar optimizations would be applicable to other multi-byte code converters.

            ilittlesunw Ian Little (Inactive)
            okutsu Masayoshi Okutsu
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: