[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openjdk-hotspot-compiler-dev
Subject:    Character.java methods are slower than Surrogate.java's
From:       Ulf.Zibis () gmx ! de (Ulf Zibis)
Date:       2009-10-28 21:44:53
Message-ID: 4AE8BB55.30506 () gmx ! de
[Download RAW message or body]

Hi Christian,

for a benchmark test I have replaced all sun.nio.cs.Surrogate methods in 
sun.nio.cs.ext.EUC_TW with corresponding ones from java.lang.Character.

As result, the overall encoding performance was 10 % worse, so 
java.lang.Character's methods must be much worser.

Can you have a look, if there is a chance to better optimize 
java.lang.Character methods from HotSpot compiler side.

The interesting classes to compare are here:
https://java-nio-charset-enhanced.dev.java.net/source/browse/java-nio-charset-enhanced \
/branches/all-in-charsets/test/sun/nio/cs/ext/EUC_TW_xueming.java?rev=805&view=markup \
https://java-nio-charset-enhanced.dev.java.net/source/browse/java-nio-charset-enhanced \
/branches/all-in-charsets/test/sun/nio/cs/ext/EUC_TW_CharSurrogate.java?rev=805&view=markup
 https://java-nio-charset-enhanced.dev.java.net/source/browse/java-nio-charset-enhance \
d/branches/all-in-charsets/test/sun/nio/cs/ext/EUC_TWBenchmark.java?rev=805&view=markup
 https://java-nio-charset-enhanced.dev.java.net/source/browse/java-nio-charset-enhanced/branches/all-in-charsets/src/sun/nio/cs/ext/EUC_TW.java?rev=805&view=markup


If you like to build the project, follow the instructions on 
https://java-nio-charset-enhanced.dev.java.net/

My Results (EUC_TW_xueming is current JDK-algorithm, compare to 
EUC_TW_CharSurrogate):
EUC_TW               65536 ASCII chars in  315 ms  encoded to 65536 bytes
EUC_TW_CharSurrogate 65536 ASCII chars in  346 ms  encoded to 65536 bytes
EUC_TW_xueming       65536 ASCII chars in  290 ms  encoded to 65536 bytes

EUC_TW               65536 UniCodeBMP chars in  805 ms  encoded to 
231782 bytes
EUC_TW_CharSurrogate 65536 UniCodeBMP chars in  810 ms  encoded to 
231782 bytes
EUC_TW_xueming       65536 UniCodeBMP chars in  717 ms  encoded to 
231782 bytes

EUC_TW               65536 UniCodeCJK chars in  580 ms  encoded to 
131072 bytes
EUC_TW_CharSurrogate 65536 UniCodeCJK chars in  592 ms  encoded to 
131072 bytes
EUC_TW_xueming       65536 UniCodeCJK chars in  473 ms  encoded to 
131072 bytes

-Ulf


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic