On Tue, 21 Feb 2023 09:33:07 GMT, Eirik Bjorsnos <d...@openjdk.org> wrote:

> I have the feeling that most case-insensitive comparisons are pretty short, 
> so not sure how useful this is IRL.

There seems to be a win from strings of size 32 bytes upwards. (That's probably 
longer than most keys in TreeMaps using String.CASE_INSENSITIVE_ORDER, such as 
j.n.h.HttpHeaders)


Benchmark                    (size)  Mode  Cnt   Score   Error  Units
EqualsIgnoreCase.scalar          16  avgt    2  20.608          ns/op
EqualsIgnoreCase.scalar          32  avgt    2  36.510          ns/op
EqualsIgnoreCase.vectorized      16  avgt    2  18.601          ns/op
EqualsIgnoreCase.vectorized      32  avgt    2  12.795          ns/op


This is outside scope for this PR, I just wanted to leave a trace of this 
observation here for future record.

-------------

PR: https://git.openjdk.org/jdk/pull/12623

Reply via email to