astange1 opened a new pull request, #525:
URL: https://github.com/apache/wicket/pull/525

   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.
   
   I believe there are some other performance improvements available in this 
class, but they will take more time to suss out.


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