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

Use encodeASCII for ASCII-compatible DoubleByte encodings

XMLWordPrintable

        The recently added encodeASCII optimization is applicable to most DoubleByte encodings, which brings performance up to levels close to ISO-8859-1 for encoding ASCII-only char[]s.

        Before:
        Benchmark (size) (type) Mode Cnt Score Error Units
        CharsetEncodeDecode.encode 16384 ISO-8859-1 avgt 30 3.021 ± 0.120 us/op
        CharsetEncodeDecode.encode 16384 Shift-JIS avgt 30 47.793 ± 1.942 us/op
        CharsetEncodeDecode.encode 16384 GB2312 avgt 30 49.598 ± 2.006 us/op
        CharsetEncodeDecode.encode 16384 EUC-JP avgt 30 68.709 ± 5.019 us/op
        CharsetEncodeDecode.encode 16384 EUC-KR avgt 30 48.033 ± 1.651 us/op

        After:
        Benchmark (size) (type) Mode Cnt Score Error Units
        CharsetEncodeDecode.encode 16384 ISO-8859-1 avgt 30 2.856 ± 0.078 us/op
        CharsetEncodeDecode.encode 16384 Shift-JIS avgt 30 5.287 ± 0.209 us/op
        CharsetEncodeDecode.encode 16384 GB2312 avgt 30 5.490 ± 0.251 us/op
        CharsetEncodeDecode.encode 16384 EUC-JP avgt 30 7.657 ± 0.368 us/op
        CharsetEncodeDecode.encode 16384 EUC-KR avgt 30 5.718 ± 0.267 us/op

              redestad Claes Redestad
              redestad Claes Redestad
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: