Fixed XenForo_Link doesn't cache includeTitleInUrls & routeFiltersOut

Xon

Well-known member
In the XenForo_Link::buildPublicLink and in the XenForo_Link::buildIntegerAndTitleUrlComponent code path; includeTitleInUrls & routeFiltersOut are both fetched directly out of the Zend Registry without an class-local caching.

Commonly hit options such as_useFriendlyUrls & _romanizeTitles & _indexRoute use a class static variable, and this has a minor performance improvement over calling XenForo_Application::Get() in what is effectively a tight loop.

While the overhead is not that great, buildPublicLink is called a lot. And the saving will obviously depend on the page.
 
I have changed this, though on a normal page I doubt you're going to see a difference. If you generate 10,000 links on a page you may see a very small difference.
 
Top Bottom