String.lastIndexOf confused by unpaired trailing surrogate
Martin Buchholz
martinrb at google.com
Sun Mar 21 12:35:04 UTC 2010
On Sun, Mar 21, 2010 at 03:24, Ulf Zibis <Ulf.Zibis at gmx.de> wrote:
> Am 21.03.2010 09:05, schrieb Martin Buchholz:
>>
>> On Sat, Mar 20, 2010 at 15:50, Ulf Zibis<Ulf.Zibis at gmx.de> wrote:
> I think, we should not define a distinct method for this once-used 3-liner:
> for (; i < max-1; i++)
> if (v[i] == high && v[i+1] == low)
> return i - offset;
>
> HotSpots resources should not be over-stressed to inline such things, having
> more reserves for more important things.
On the contrary -
normally the above code snippet will rarely be executed,
and so will normally not be inlined into the caller,
which makes it easier for hotspot to inline
the caller into its caller. Separate cold code into
separate methods.
BTW, in case you try to benchmark this,
hotspot intrinsifies indexOf by default.
Martin
More information about the core-libs-dev
mailing list