benwtrent commented on code in PR #16092:
URL: https://github.com/apache/lucene/pull/16092#discussion_r3280829158


##########
lucene/core/src/java/org/apache/lucene/codecs/lucene104/Lucene104ScalarQuantizedVectorsReader.java:
##########
@@ -81,26 +83,40 @@ public class Lucene104ScalarQuantizedVectorsReader extends 
FlatVectorsReader
   private final IndexInput quantizedVectorData;
   private final FlatVectorsReader rawVectorsReader;
   private final Lucene104ScalarQuantizedVectorScorer vectorScorer;
+  private final FieldInfos fieldInfos;
+
+  /** Lazily built Hadamard rotations, keyed by field name. */
+  private final Map<String, HadamardRotation> rotations = new 
ConcurrentHashMap<>();

Review Comment:
   I don't know about this. This isn't cheap. We have 
"field*num_segments*size(HadamardRotationObject)", 
   
   Seems to me the rotation matrix should just be stored off heap :/ Or the 
rotation is by dimension, not by field name (idk why we need a new random 
matrix for this for two fields that have the same dimension).



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to