RFR: 8303401: Add a Vector API equalsIgnoreCase micro benchmark [v8]

Eirik Bjorsnos duke at openjdk.org
Wed Mar 1 17:52:36 UTC 2023


> This PR suggests we add a vectorized equalsIgnoreCase benchmark to the set of benchmarks in `org.openjdk.bench.jdk.incubator.vector`. This benchmark serves as an example of how vectorization can be useful also in the area of text processing. It takes advantage of the fact that ASCII and Latin-1 were designed to optimize case-twiddling operations.
> 
> The code came about during the work on #12632, where vectorization was deemed out of scope.
> 
> Benchmark results:
> 
> 
> Benchmark                             (size)  Mode  Cnt     Score   Error  Units
> EqualsIgnoreCaseBenchmark.scalar          16  avgt   15    21.575 ± 0.365  ns/op
> EqualsIgnoreCaseBenchmark.scalar          32  avgt   15    43.199 ± 2.786  ns/op
> EqualsIgnoreCaseBenchmark.scalar          64  avgt   15    71.389 ± 0.891  ns/op
> EqualsIgnoreCaseBenchmark.scalar         128  avgt   15   146.827 ± 1.115  ns/op
> EqualsIgnoreCaseBenchmark.scalar        1024  avgt   15  1062.759 ± 9.331  ns/op
> EqualsIgnoreCaseBenchmark.vectorized      16  avgt   15    21.483 ± 0.121  ns/op
> EqualsIgnoreCaseBenchmark.vectorized      32  avgt   15    10.538 ± 0.125  ns/op
> EqualsIgnoreCaseBenchmark.vectorized      64  avgt   15    13.182 ± 0.177  ns/op
> EqualsIgnoreCaseBenchmark.vectorized     128  avgt   15    19.192 ± 0.421  ns/op
> EqualsIgnoreCaseBenchmark.vectorized    1024  avgt   15    92.521 ± 3.494  ns/op

Eirik Bjorsnos has updated the pull request incrementally with one additional commit since the last revision:

  Add whitespace after if

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/12790/files
  - new: https://git.openjdk.org/jdk/pull/12790/files/29b213c3..d4802538

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=12790&range=07
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=12790&range=06-07

  Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod
  Patch: https://git.openjdk.org/jdk/pull/12790.diff
  Fetch: git fetch https://git.openjdk.org/jdk pull/12790/head:pull/12790

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


More information about the core-libs-dev mailing list