RFR: JDK-8032012, , String.toLowerCase/toUpperCase performance improvement
Ulf Zibis
Ulf.Zibis at CoSoCo.de
Thu Jan 16 19:42:13 UTC 2014
Hi Sherman,
nice performance trick :-)
Do you remember the discussion about :
https://bugs.openjdk.java.net/browse/JDK-6939278 ;-)
(this bug was originally filed by me!)
-Ulf
Am 16.01.2014 19:08, schrieb Xueming Shen:
> Hi,
>
> The proposed changeset is to improve the performance (both speed and memory
> usage) of String.toLowerCase/toUpperCase, by
>
> (1) to separate the "most likely" use scenario (non supplementary character, no special
> case mapping handling) into simple/quick iteration loop code path
> (2) to use the package private constructor String(char[], boolean) to avoid unnecessary
> target char[] copy in fast-path case.
> (3) some tiny code cleanup.
>
> Since it's supposed to be a simple/quick round of code cleanup, I did not go too far to
> optimize the supplementary/special mapping code.
>
> The webrev is
>
> http://cr.openjdk.java.net/~sherman/8032012/
>
> My small non-scientific speed measurement test suggests we can get 25% to 40%
> speed boost.
>
> http://cr.openjdk.java.net/~sherman/str_toCase/TestToCase.java
>
> Thanks!
> -Sherman
>
More information about the core-libs-dev
mailing list