I am profiling the performance of a website with a decent amount of blocks, images and links on the start page. In general it is fast, even under fair load. I use the Bombardier tool (2000 requests with 20 concurrent connections) for a simple load test on my development machine.
However, what sticks out a lot from the recorded profiler data is that URL resolving accounts for almost all of the call time and an excessive memory usage (around 2 GB during the said load test).
I can see that all links are always resolved from cached content on each request. E.g., calling Url.ContentUrl on a ContentReference to an image, seems to load that content item from cache (or DB on first load), as well as all its parent containers, in order to resolve the URL. Apparently, the resulting URL is not cached, because this process gets repeated for all request in my load test.
Is there a simple way of enabling caching of generated URLs acrosss requests? It could be short-lived caching, or it could be long-lived with content dependency keys.
Or would I have to sub-class DefaultUrlResolver and add such logic?