-
Bug
-
Resolution: Fixed
-
P3
-
1.4.2_03
-
1.4.1
-
b01
-
generic, x86
-
windows_xp
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-2120683 | 6 | Martin Buchholz | P3 | Resolved | Fixed | mustang |
JDK-2120682 | 5.0u1 | Martin Buchholz | P3 | Resolved | Fixed | 01 |
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
================================================================================
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
================================================================================
- backported by
-
JDK-2120682 (cs) Charset.isSupported is slow when invoked for different charsets
- Resolved
-
JDK-2120683 (cs) Charset.isSupported is slow when invoked for different charsets
- Resolved
- duplicates
-
JDK-5002893 Perf. deterioration in 1.4.2 when many charset switches
- Closed
- relates to
-
JDK-4806753 Using alternating charsets with String(byte[]) and String.getBytes is very slow
- Resolved
-
JDK-5107263 Worse performance of isSupported for JISAutoDetect (1.4.X)
- Closed