mikemccand commented on code in PR #11847:
URL: https://github.com/apache/lucene/pull/11847#discussion_r1380002867


##########
lucene/core/src/java/org/apache/lucene/codecs/lucene94/Lucene94FieldInfosFormat.java:
##########
@@ -145,8 +145,10 @@ public FieldInfos read(
         // previous field's attribute map, we share when possible:
         Map<String, String> lastAttributes = Collections.emptyMap();
 
+        CanonicalStringCache cache = new CanonicalStringCache();
+
         for (int i = 0; i < size; i++) {
-          String name = input.readString();
+          String name = cache.readString(input);

Review Comment:
   I'm confused how this helps?  The string cache is used only while loading a 
single `FieldInfos` from the index, but the strings we pass to it for caching 
are field names, which (in the context of this one for loop) are all unique 
strings?



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

Reply via email to