EUC-TW Decoder up to 100% faster, especially on ASCII on JDK-7 -server
Ulf Zibis
Ulf.Zibis at gmx.de
Thu Aug 20 15:44:16 UTC 2009
Oops, the link is:
https://java-nio-charset-enhanced.dev.java.net/source/browse/java-nio-charset-enhanced/branches/all-in-charsets/test/sun/nio/cs/ext/EUC_TWBenchmark.java
The "way" you can see here (the trick is in the CoderResult escape methods):
https://java-nio-charset-enhanced.dev.java.net/source/browse/java-nio-charset-enhanced/branches/all-in-charsets/src/sun/nio/cs/FastCharset.java?rev=&view=markup
There is no price of "double-byte" coding for "ascii" performance. :-)
Now I'm working on:
http://bugs.sun.com/bugdatabase/addVote.do?bug_id=6873330
-Ulf
Am 20.08.2009 17:21, Xueming Shen schrieb:
> Ulf,
>
> My apology that I have not looked into your recent proposals (I did
> quickly scan the change) as I
> should have to, mostly because I shifted myself out of charsets for
> some other stuff the last couple
> weeks/month...I will get back to it to finish some my leftover and
> pick up your stuff after I finish the
> zlib123 upgrade, hopefully soon.
>
> The link below does not seem work...and can you detail th "way" you
> found (from the name the
> link is the benchmark). Does the "ascii benefit" come with the cost
> of "non-ascii" decoding? I'm
> asking because in case of double-byte charset, you don't want to pay a
> price of "double-byte"
> coding for "ascii" performance, but other way around. the performance
> of "double-byte" is
> more important.
>
> sherman
>
> Ulf Zibis wrote:
>> Hi Sherman, Martin and all,
>>
>> I have found a way, how to speed-up charset decoders in a general
>> way. In case of EUC-TW it does speed-up to 100 % (on ASCII on JDK-7
>> -server)
>>
>> Here the output of my benchmark:
>> (see code:
>> https://java-nio-charset-enhanced.dev.java.net/source/browse/java-nio-charset-enhanced/branches/test/sun/nio/cs/ext/EUC_TWBenchmark.java)
>>
>>
>> java.version : 1.7.0-ea
>> java.vm.version : 16.0-b07
>> time to instantiate EUC_TW_xueming: 8716 µs
>> time to instantiate EUC_TW_int: 4802 µs
>> time to instantiate EUC_TW: 2819 µs
>> time to instantiate EUC_TW_ASCII_inl: 4806 µs
>> time to init decoder EUC_TW_xueming: 5873 µs
>> time to init encoder EUC_TW_xueming: 33726 µs
>> time to init decoder EUC_TW_int: 6618 µs
>> time to init encoder EUC_TW_int: 25075 µs
>> time to init decoder EUC_TW: 5404 µs
>> time to init encoder EUC_TW: 21776 µs
>> time to init decoder EUC_TW_ASCII_inl: 7827 µs
>> time to init encoder EUC_TW_ASCII_inl: 24514 µs
>> time to instantiate TestEUC_TW: 3075 µs
>> time for warm up 1: 608 ms
>> time for warm up 2: 470 ms
>> time for warm up 3: 496 ms
>> time for warm up 4: 487 ms
>> time for EUC_TW_xueming ASCII decode: 505 ms
>> time for EUC_TW_int ASCII decode: 282 ms
>> time for EUC_TW ASCII decode: 255 ms
>> time for EUC_TW_ASCII_inl ASCII decode: 303 ms
>> time for EUC_TW_xueming Plane0 decode: 687 ms
>> time for EUC_TW_int Plane0 decode: 623 ms
>> time for EUC_TW Plane0 decode: 632 ms
>> time for EUC_TW_ASCII_inl Plane0 decode: 621 ms
>> last warm up ./. test loops: 1.2456994
>>
>> -Ulf
>>
>>
>
>
More information about the core-libs-dev
mailing list