Cache page content language in Title object
authorBrian Wolff <bawolff+wn@gmail.com>
Sun, 20 Oct 2013 20:48:19 +0000 (17:48 -0300)
committerBrian Wolff <bawolff+wn@gmail.com>
Sun, 27 Oct 2013 23:18:20 +0000 (20:18 -0300)
commit8f4f9404ce7700f4776bf93b3bf0ed5578a7ac5f
tree118d468ff82aa7a616bb1627a7e684c784451722
parent6985d304dbf855562432464d868ad5eae704a416
Cache page content language in Title object

During the parsing process, $title->getPageLanguage() gets called
a large number of times for the same title. Apparently the value
can vary by user, but it should be safe to cache for the current
request (I believe).

On [[Commons:Commons:Featured_picture_candidates/Log/October_2013]],
it appears that this method is called 5118 times, and represents
20.58% (11.77 seconds) of the time to render the page.

Also checks if $wgLanguageCode has been changed, since Title
object are cached during a request, and the unit tests seem
to change $wgLanguageCode/$wgContLang while still using
the Title cache.

Bug: 55952
Change-Id: I84b2d86c7bcb32997acff47cfea0f789b5b960a6
includes/Title.php