Make LocalisationCache a service
authorAryeh Gregor <ayg@aryeh.name>
Wed, 1 May 2019 13:56:41 +0000 (16:56 +0300)
committerJames D. Forrester <jforrester@wikimedia.org>
Tue, 8 Oct 2019 20:31:48 +0000 (13:31 -0700)
commitfadd3277f73c8922cea2443a7e6566f54726fbbc
tree4b173de57f4a95e7e44481982af2dfb01f2f72a2
parent8e0ef3e187b4b8ebe847dbc8ae1ec2b96ed58ae0
Make LocalisationCache a service

This removes Language::$dataCache without deprecation, because 1) I
don't know of a way to properly simulate it in the new paradigm, and 2)
I found no direct access to the member outside of the Language and
LanguageTest classes.

An earlier version of this patch (e4468a1d6b6) had to be reverted
because of a massive slowdown on test runs. Based on some local testing,
this should fix the problem. Running all tests in languages is slowed
down by only around 20% instead of a factor of five, and memory usage is
actually reduced greatly (~350 MB -> ~200 MB). The slowdown is still not
great, but I assume it's par for the course for converting things to
services and is acceptable. If not, I can try to optimize further.

Bug: T231220
Bug: T231198
Bug: T231200
Bug: T201405
Change-Id: Ieadbd820379a006d8ad2d2e4a1e96241e172ec5a
(cherry picked from commit 043d88f680cf66c90e2bdf423187ff8b994b1d02)
16 files changed:
RELEASE-NOTES-1.34
includes/DefaultSettings.php
includes/MediaWikiServices.php
includes/ServiceWiring.php
includes/cache/localisation/LocalisationCache.php
includes/installer/Installer.php
languages/Language.php
maintenance/rebuildLocalisationCache.php
tests/common/TestSetup.php
tests/common/TestsAutoLoader.php
tests/phpunit/MediaWikiIntegrationTestCase.php
tests/phpunit/includes/TestLocalisationCache.php [new file with mode: 0644]
tests/phpunit/includes/cache/LocalisationCacheTest.php
tests/phpunit/includes/logging/LogFormatterTest.php
tests/phpunit/languages/LanguageTest.php
tests/phpunit/unit/includes/resourceloader/ResourceLoaderImageTest.php