[ 
https://issues.apache.org/jira/browse/WICKET-7042?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17710791#comment-17710791
 ] 

ASF GitHub Bot commented on WICKET-7042:
----------------------------------------

theigl commented on code in PR #573:
URL: https://github.com/apache/wicket/pull/573#discussion_r1162428244


##########
wicket-core/src/main/java/org/apache/wicket/response/StringResponse.java:
##########
@@ -30,6 +30,8 @@
 public class StringResponse extends Response
 {
 
+       private static final int DEFAULT_INITIAL_CAPACITY = 128;

Review Comment:
   > This is a problem indeed!
   > We can improve StringResponse in 10.x and introduce LazyStringResponse in 
9.x as deprecated.
   
   @martin-g: I can do that. But in what order should I do it? Should I merge 
the PRs as they are now, then backport them and then deprecate 
`LazyStringResponse` in 9.x and unify the responses in 10x? Or should I unify 
them now and create a separate PR for backporting? What do you usually do in 
such a case?





> Improve sizing of StringResponse when writing scripts in PartialPageResponse
> ----------------------------------------------------------------------------
>
>                 Key: WICKET-7042
>                 URL: https://issues.apache.org/jira/browse/WICKET-7042
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket-core
>    Affects Versions: 9.12.0
>            Reporter: Thomas Heigl
>            Assignee: Thomas Heigl
>            Priority: Major
>
> When rendering scripts in PartialPageResponse, an AppendingStringBuilder with 
> initial capacity 1024 is created. This buffer is then written to a 
> StringResponse that uses a buffer with an initial capacity of 128 causing 
> unnecessary allocations.
> We should create the StringResponse with enough capacity to hold the scripts.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to