[ https://issues.apache.org/jira/browse/WICKET-6776?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17099681#comment-17099681 ]
Thomas Heigl commented on WICKET-6776: -------------------------------------- Shall I create a PR for this? I have deployed this to production and it works fine, but returning immutable URLs might theoretically break other users applications. > Cache Urls returned from ServletWebRequest > ------------------------------------------ > > Key: WICKET-6776 > URL: https://issues.apache.org/jira/browse/WICKET-6776 > Project: Wicket > Issue Type: Improvement > Components: wicket-core > Affects Versions: 8.7.0, 9.0.0-M5 > Reporter: Thomas Heigl > Priority: Major > > Profiling in production showed that {{ServletWebRequest.getUrl()}} and > {{ServletWebRequest.getClientUrl()}} are called many times during request > processing and allocate a lot of objects. > Each call to {{ServletWebRequest.getUrl()}} creates a new {{Url}} object that > internally creates two new {{ArrayLists}}. > {{ServletWebRequest.getClientUrl()}} creates a new URL and involves a lot of > complex parsing logic. > Both methods are invoked during request mapping. We have about 350 registered > mappers, so these methods are called *at least* 350 times on each request. > Both values should be cached. -- This message was sent by Atlassian Jira (v8.3.4#803005)