United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: 6746334 SingleByteDecoder can be significantly faster
6746334 : SingleByteDecoder can be significantly faster

Details
Type:
Bug
Submit Date:
2008-09-09
Status:
Resolved
Updated Date:
2010-08-05
Project Name:
JDK
Resolved Date:
2008-11-14
Component:
core-libs
OS:
generic
Sub-Component:
java.nio.charsets
CPU:
generic
Priority:
P2
Resolution:
Fixed
Affected Versions:
6
Fixed Versions:
6u12

Related Reports

Sub Tasks

Description
Attached test measures performance of BufferedReader.readline() and it seems that noticiable fraction of 
time is spent in sun.nio.cs.SingleByteDecoder.decodeLoop().

Performance seems to improve significantly if SingleByteDecoder is changed to use char array for 
byteToChar table instead of String. See suggested change in attachment.

In my experiments this change helps to improve performance of ReadlinePerf test by 35-40% - 
time drops from from ~1200ms to 740ms (tested on Windows Vista and XP). 

It also have noticeable impact on reading deployment cache. In my experiments performance 
savings are around 5-7% (reading manifests from index files by CacheEntry).

                                    

Comments
EVALUATION

Suggested fix is attached.
                                     
2008-09-09



Hardware and Software, Engineered to Work Together