<div dir="ltr">Hi,<div><br><div>I've been working on <a href="https://github.com/openjdk/jdk/pull/12623">https://github.com/openjdk/jdk/pull/12623</a> (which speeds up latin1 equalsIgnoreCase using 'the oldest ASCII trick in the book).</div><div><br></div><div>I was thinking that this trick could lend itself to vectorization, so I made a quick exploration using the Vector API. (JMH results below)</div><div><br></div><div>While a vectorized implementation is out of scope for the current PR, perhaps it could be useful to include this benchmark along the Vector API benchmarks?</div><div><br></div><div>It's my first time writing Vector API code (or any SIMD code at all), so this could probably be improved (a lot!):</div><div><br></div><div><a href="https://github.com/openjdk/jdk/compare/master...eirbjo:jdk:vectorized-equalsignorecase">https://github.com/openjdk/jdk/compare/master...eirbjo:jdk:vectorized-equalsignorecase</a><br></div><div><br></div><div>Let me know if there is interest in including this, and I can go ahead and make a PR.</div><div><br></div><div>Cheers, </div><div>Eirik.</div><div><br></div><div><br></div><div>Results:</div><div><br></div><font face="monospace">Benchmark                             (size)  Mode  Cnt     Score   Error  Units<br>EqualsIgnoreCaseBenchmark.scalar          16  avgt   15    20.671 ± 0.718  ns/op<br>EqualsIgnoreCaseBenchmark.scalar          32  avgt   15    46.155 ± 3.258  ns/op<br>EqualsIgnoreCaseBenchmark.scalar          64  avgt   15    68.248 ± 1.767  ns/op<br>EqualsIgnoreCaseBenchmark.scalar         128  avgt   15   148.948 ± 0.890  ns/op<br>EqualsIgnoreCaseBenchmark.scalar        1024  avgt   15  1090.708 ± 7.540  ns/op<br>EqualsIgnoreCaseBenchmark.vectorized      16  avgt   15    21.872 ± 0.232  ns/op<br>EqualsIgnoreCaseBenchmark.vectorized      32  avgt   15    11.378 ± 0.097  ns/op<br>EqualsIgnoreCaseBenchmark.vectorized      64  avgt   15    13.703 ± 0.135  ns/op<br>EqualsIgnoreCaseBenchmark.vectorized     128  avgt   15    21.632 ± 0.735  ns/op<br></font><div><font face="monospace">EqualsIgnoreCaseBenchmark.vectorized    1024  avgt   15   105.509 ± 7.493  ns/op</font> </div></div></div>