[
https://issues.apache.org/jira/browse/WICKET-6991?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17560794#comment-17560794
]
Maxim Solodovnik commented on WICKET-6991:
------------------------------------------
verified, fixed :)
Thanks [~bitstorm]!
> ResourceAggregator is resizing the StringBuilder several times.
> ---------------------------------------------------------------
>
> Key: WICKET-6991
> URL: https://issues.apache.org/jira/browse/WICKET-6991
> Project: Wicket
> Issue Type: Improvement
> Affects Versions: 9.10.0
> Reporter: Andrea Del Bene
> Assignee: Andrea Del Bene
> Priority: Minor
> Fix For: 10.0.0, 9.11.0
>
>
> ResourceAggregator is resizing the StringBuilder several times, and then
> calling toString() on the result.
> In a few of our pages, this StringBuilder grows to ~650KB in size, which
> happens through a series of resizes and copies. We should count up the sizes
> ahead of time, but can't as the OnEventHeaderItem allocates a buffer when
> getCompleteJavaScript is called. Instead make an estimate of the size of the
> builder to avoid repeated resizing and array copies.
> Also, remove redundant toString() call. This creates a copy of the ~650KB
> byte array into a new String instance, which isn't needed. The subsequent
> concatenation in the render() call should use the underlying byte[] in the
> StringBuilder on newer JDK versions with more advanced JEP 280
> implementations.
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)