Vectorized latin1 equalsIgnoreCase
Viswanathan, Sandhya
sandhya.viswanathan at intel.com
Fri Feb 24 01:17:16 UTC 2023
Hi Eirik,
Yes, it will be wonderful to add this benchmark. Please go ahead and create a PR.
If there are objections to adding it to mainline JDK, we could fall back to the panama-vectror vectorIntrinsics branch.
Best Regards,
Sandhya
From: panama-dev <panama-dev-retn at openjdk.org> On Behalf Of Eirik Bjørsnøs
Sent: Tuesday, February 21, 2023 2:56 AM
To: panama-dev at openjdk.org
Subject: Vectorized latin1 equalsIgnoreCase
Hi,
I've been working on https://github.com/openjdk/jdk/pull/12623 (which speeds up latin1 equalsIgnoreCase using 'the oldest ASCII trick in the book).
I was thinking that this trick could lend itself to vectorization, so I made a quick exploration using the Vector API. (JMH results below)
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?
It's my first time writing Vector API code (or any SIMD code at all), so this could probably be improved (a lot!):
https://github.com/openjdk/jdk/compare/master...eirbjo:jdk:vectorized-equalsignorecase
Let me know if there is interest in including this, and I can go ahead and make a PR.
Cheers,
Eirik.
Results:
Benchmark (size) Mode Cnt Score Error Units
EqualsIgnoreCaseBenchmark.scalar 16 avgt 15 20.671 ± 0.718 ns/op
EqualsIgnoreCaseBenchmark.scalar 32 avgt 15 46.155 ± 3.258 ns/op
EqualsIgnoreCaseBenchmark.scalar 64 avgt 15 68.248 ± 1.767 ns/op
EqualsIgnoreCaseBenchmark.scalar 128 avgt 15 148.948 ± 0.890 ns/op
EqualsIgnoreCaseBenchmark.scalar 1024 avgt 15 1090.708 ± 7.540 ns/op
EqualsIgnoreCaseBenchmark.vectorized 16 avgt 15 21.872 ± 0.232 ns/op
EqualsIgnoreCaseBenchmark.vectorized 32 avgt 15 11.378 ± 0.097 ns/op
EqualsIgnoreCaseBenchmark.vectorized 64 avgt 15 13.703 ± 0.135 ns/op
EqualsIgnoreCaseBenchmark.vectorized 128 avgt 15 21.632 ± 0.735 ns/op
EqualsIgnoreCaseBenchmark.vectorized 1024 avgt 15 105.509 ± 7.493 ns/op
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/panama-dev/attachments/20230224/b0be428f/attachment-0001.htm>
More information about the panama-dev
mailing list