RamakrishnaChilaka opened a new pull request, #15043: URL: https://github.com/apache/lucene/pull/15043
### Description While reviewing [apache/lucene#14896](https://github.com/apache/lucene/pull/14896) I noticed that the post-dot-product division step in VectorUtil.l2normalize was still scalar. This PR vectorises only the division loop, leaving the existing fast Panama dot-product untouched. Benchmarks ``` Benchmark (size) Mode Cnt Score Error Units VectorUtilBenchmark.l2Normalize 1 thrpt 15 328.829 ± 41.535 ops/us VectorUtilBenchmark.l2Normalize 128 thrpt 15 24.009 ± 0.603 ops/us VectorUtilBenchmark.l2Normalize 207 thrpt 15 13.517 ± 0.403 ops/us VectorUtilBenchmark.l2Normalize 256 thrpt 15 10.178 ± 0.619 ops/us VectorUtilBenchmark.l2Normalize 300 thrpt 15 9.360 ± 0.450 ops/us VectorUtilBenchmark.l2Normalize 512 thrpt 15 5.107 ± 0.081 ops/us VectorUtilBenchmark.l2Normalize 702 thrpt 15 3.528 ± 0.084 ops/us VectorUtilBenchmark.l2Normalize 1024 thrpt 15 2.365 ± 0.051 ops/us VectorUtilBenchmark.l2NormalizeVector 1 thrpt 75 350.457 ± 6.117 ops/us VectorUtilBenchmark.l2NormalizeVector 128 thrpt 75 54.459 ± 3.576 ops/us VectorUtilBenchmark.l2NormalizeVector 207 thrpt 75 34.701 ± 1.698 ops/us VectorUtilBenchmark.l2NormalizeVector 256 thrpt 75 35.159 ± 2.050 ops/us VectorUtilBenchmark.l2NormalizeVector 300 thrpt 75 28.488 ± 1.801 ops/us VectorUtilBenchmark.l2NormalizeVector 512 thrpt 75 21.058 ± 1.236 ops/us VectorUtilBenchmark.l2NormalizeVector 702 thrpt 75 15.002 ± 0.688 ops/us VectorUtilBenchmark.l2NormalizeVector 1024 thrpt 75 11.616 ± 0.394 ops/us ``` Summarising speed-up. | size | scalar | vector | speed-up | | ---- | ------ | ------ | -------- | | 128 | 24.0 | 54.5 | **2.3×** | | 512 | 5.1 | 21.1 | **4.1×** | | 1024 | 2.4 | 11.6 | **4.8×** | -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For additional commands, e-mail: issues-h...@lucene.apache.org