Page MenuHomePhabricator

$title->getPageLanguage not cached at all, called thousands of times on the same title
Closed, ResolvedPublic


profiling output from Commons:Featured_picture_candidates/Log/October_2013

Patch awaiting review at gerrit change 90769

$title->getPageLanguage() gets called a lot (sometimes in the thousands of calls). Usually for the same page. This calls a hook, which can be somewhat expensive. There should be an in-process cache for it.

In particular, for we have the following profiling lines:

22.42% 12.819275 5118 - hook: PageContentLanguage
20.58% 11.766860 5118 - PageTranslationHooks::onPageContentLanguage

There may be more things that can be optimized for that page perhaps. I included some profiling data as an attachment.

For original context see

Version: 1.22.0
Severity: normal




Event Timeline

bzimport raised the priority of this task from to High.Nov 22 2014, 2:20 AM
bzimport set Reference to bz55952.
bzimport added a subscriber: Unknown Object (MLST).
Bawolff created this task.Oct 20 2013, 10:24 PM

Change 90769 had a related patch set uploaded by Brian Wolff:
Cache page content language in Title object.

Change 90769 merged by jenkins-bot:
Cache page content language in Title object