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


##########
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:
   > idk why we need a new random matrix for this for two fields that have the 
same dimension
   
   It was because the random seed is taking the field name into picture but I 
agree to your point we could reuse the same matrix across vectors of same 
dimension actually (likely there is no/much benefit of having random seeds 
other than avoiding the possibility of choosing a bad seed for all vector 
fields but this simplification overshadows that possibility without completely 
discarding). I'll try to stick to a single rotation matrix for a dimension 
only. Do you think there is enough value of moving it off heap after having 1 
rotation or it'll be an overkill?



-- 
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