reiern70 commented on code in PR #579:
URL: https://github.com/apache/wicket/pull/579#discussion_r1168202846


##########
wicket-util/src/main/java/org/apache/wicket/util/string/Strings.java:
##########
@@ -1089,7 +1089,7 @@ public static CharSequence toMultilineMarkup(final 
CharSequence s)
                        return null;
                }
 
-               final AppendingStringBuffer buffer = new 
AppendingStringBuffer();
+               final AppendingStringBuffer buffer = new 
AppendingStringBuffer((int) (s.length() * 1.1));

Review Comment:
   > I don't think so. The additional 10% should be enough to accommodate 
markup and escaping overhead in most cases. And if it isn't enough, the buffer 
is resized once. This is _much_ better than resizing the buffer almost every 
time as it is now. Imho there is no need to configure or optimize this further.
   
   Yes... I after I wrote my comment I looked at soucre code and I realized the 
10% more should be enough. Maybe what we can have is a 
TenPercentMoreAppendingStringBuffer class?



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

Reply via email to