String.lastIndexOf confused by unpaired trailing surrogate

Ulf Zibis Ulf.Zibis at gmx.de
Tue Mar 23 12:58:01 UTC 2010


Am 23.03.2010 00:14, schrieb Ulf Zibis:
> Am 22.03.2010 21:08, schrieb Martin Buchholz:
>> On Mon, Mar 22, 2010 at 07:45, Ulf Zibis<Ulf.Zibis at gmx.de>  wrote:
>>> Am 21.03.2010 18:38, schrieb Martin Buchholz:
>>>> Even if I'm wrong, and this cold code is actually hot,
>>>> I don't think there will be a big performance loss.
>>>> The method call is outside the loop.
>>>>
>>> What about at least reusing the cached values from calling method via
>>> indexOfSupplementary(ch, fromIndex, value, offset, max - 1) ?
>> No.  We're optimizing for BMP.
>
> There would be no harm on BMP case speed. HotSpot wouldn't copy the 
> values to stack if (1) ch is a BMP character and (2) 
> indexOfSupplementary() becomes inlined.
> I think Sherman is right in "dont have to have the redundant 
> value/offset=this.value/offset".

Additionally if indexOfSupplementary() would be static, transfer of this 
pointer would be saved.

-Ulf





More information about the core-libs-dev mailing list