3 ms·
Great explanation. But to be clear to those who don't follow: SIMD is supported by Java out of the box but the optimizer might miss some opportunities. With th
by invalidname 3y ago
Great explanation. But to be clear to those who don't follow:
SIMD is supported by Java out of the box but the optimizer might miss some opportunities. With this API it is far more likely that SIMD will be used if it's available and on first compilation so performance should be improved.
- re-thc 3y ago> SIMD is supported by Java out of the box but the optimizer might miss some opportunities It's a little limited due to how objects are stored in memory. Might improve with Valhalla.
- dzaima 3y agoLucene here just dealing with plain float[]s, so Valhalla at least shouldn't affect it much. It seems the limiting thing here is that it has sum accumulators, which the optimizer can't reorder because addition isn't associative. (for reference: scalar impl: https://github.com/ChrisHegarty/lucene/blob/dd4eaac9af346a21fca3c79ac989e368754c583e/lucene/core/src/java/org/apache/lucene/util/VectorUtilDefaultProvider.java https://github.com/ChrisHegarty/lucene/blob/dd4eaac9af346a21... and SIMD impl: https://github.com/ChrisHegarty/lucene/blob/dd4eaac9af346a21fca3c79ac989e368754c583e/lucene/core/src/java20/org/apache/lucene/util/VectorUtilPanamaProvider.java https://github.com/ChrisHegarty/lucene/blob/dd4eaac9af346a21...)