[ https://issues.apache.org/jira/browse/WICKET-6776?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17113183#comment-17113183 ]
Martin Tzvetanov Grigorov commented on WICKET-6776: --------------------------------------------------- We can deprecate them even after 9.0.0 is released. Let's see what the new API will look like so we know what to use as a deprecation message. > 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)