tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [tomcat] bokken commented on a change in pull request #143: Apply deduplication to certain loaded and created Strings
Date Fri, 26 Jul 2019 18:48:23 GMT
bokken 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_r307868511
 
 

 ##########
 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:
   What was the observed benefit from using String.intern()?
   My take away from Aleksey's article was that String.intern should effectively never be
used.
   If the only observed benefit was removal of long lived "duplicate" strings, then the [G1
string dedup](http://openjdk.java.net/jeps/192) already provides the majority of that benefit
with none of the drawbacks of intern usage. 

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message