dweiss commented on code in PR #11847:
URL: https://github.com/apache/lucene/pull/11847#discussion_r1012761533
##########
lucene/core/src/java/org/apache/lucene/store/DataInput.java:
##########
@@ -280,6 +281,18 @@ public String readString() throws IOException {
return new String(bytes, 0, length, StandardCharsets.UTF_8);
}
+ private final Map<String, String> canonicalStrings = new HashMap<>();
Review Comment:
I think this breaks with Cloneable, doesn't it? Just the reference to the
same map instance would be cloned. I have no strong opinion about the string
cache itself. It's a separate, explicit method so the risk of it breaking
existing stuff is small... if it indeed helps the problem then it looks fine to
me.
--
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]