apache / lucene

Apache Lucene open-source search software
https://lucene.apache.org/
Apache License 2.0
2.58k stars 1.01k forks source link

Investigate possible perf regression with off-heap scoring on JDK 22 #13575

Open ChrisHegarty opened 1 month ago

ChrisHegarty commented 1 month ago

Investigate possible perf regression with off-heap scoring on JDK 22.

relates #13497

ChrisHegarty commented 1 month ago

On main running on ARM, I don't see any difference between JDK 21 and JDK 22. Here's the output of the VectorScorerBenchmark.

$ /Users/chegar/binaries/jdk-21.0.2.jdk/Contents/Home/bin/java -jar lucene/benchmark-jmh/build/benchmarks/lucene-benchmark-jmh-10.0.0-SNAPSHOT.jar org.apache.lucene.benchmark.jmh.VectorScorerBenchmark.binaryDotProductMemSeg -p size=1024
...
VectorScorerBenchmark.binaryDotProductMemSeg    1024  thrpt   15  6.235 ± 0.050  ops/us
$ /Users/chegar/binaries/jdk-22.0.2.jdk/Contents/Home/bin/java -jar lucene/benchmark-jmh/build/benchmarks/lucene-benchmark-jmh-10.0.0-SNAPSHOT.jar org.apache.lucene.benchmark.jmh.VectorScorerBenchmark.binaryDotProductMemSeg -p size=1024
...
VectorScorerBenchmark.binaryDotProductMemSeg    1024  thrpt   15  6.289 ± 0.047  ops/us

Hmm... why on the same machine are these double the values I was seeing in #13339 ! ? ( I don't remember what I was thinking with this benchmark - for one it does not account for the copy on-heap. I think it was mostly to ensure that I didn't regress the non-memseg scorer )