paplorinc commented on a change in pull request #143: Apply deduplication to certain loaded and created Strings URL: https://github.com/apache/tomcat/pull/143#discussion_r269449223
########## File path: java/org/apache/tomcat/util/digester/SetPropertiesRule.java ########## @@ -62,7 +59,7 @@ public void begin(String namespace, String theName, Attributes attributes) if ("".equals(name)) { name = attributes.getQName(i); } - String value = attributes.getValue(i); + String value = attributes.getValue(i).intern(); Review comment: FYI: https://shipilev.net/jvm/anatomy-quarks/10-string-intern > In almost every project we were taking care of, removing String.intern() from the hotpaths, or optionally replacing it with a handrolled deduplicator, was the very profitable performance optimization. Do not use String.intern() without thinking very hard about it, okay? ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org