Page MenuHomePhabricator

Remove indirection of TimedMediaHandler module registration
Closed, ResolvedPublic

Description

TimedMediaHandler (in particular, the MwEmbedResourceManager) is using various layers of indirection to declare its modules. This involves opening and parsing various JSON files, on every request, without caching.

As far as I can tell, the result is entirely deterministic and should just be moved to the flat registry in the extension's entry point.

The overhead of this complex and unconditionally executed logic is present on all MediaWiki web requests.

Flame graph:

Screen Shot 2018-08-16 at 21.34.01.png (743×2 px, 216 KB)

Event Timeline

Krinkle triaged this task as Medium priority.Aug 15 2018, 6:07 PM
Krinkle created this task.

Change 452965 had a related patch set uploaded (by Krinkle; owner: Krinkle):
[mediawiki/extensions/TimedMediaHandler@master] Move simple module registration from hook to extension.json

https://gerrit.wikimedia.org/r/452965

Change 452973 had a related patch set uploaded (by Krinkle; owner: Krinkle):
[mediawiki/extensions/TimedMediaHandler@master] NewMwEmbedResourceManager: Remove unused 'messageFile' option

https://gerrit.wikimedia.org/r/452973

Change 452974 had a related patch set uploaded (by Krinkle; owner: Krinkle):
[mediawiki/extensions/TimedMediaHandler@master] NewMwEmbedResourceManager: Remove indirection around module directories

https://gerrit.wikimedia.org/r/452974

Change 452978 had a related patch set uploaded (by Krinkle; owner: Krinkle):
[mediawiki/extensions/TimedMediaHandler@master] NewMwEmbedResourceManager: Register 'mw.TimedText.loader' explicitly

https://gerrit.wikimedia.org/r/452978

Change 452987 had a related patch set uploaded (by Krinkle; owner: Krinkle):
[mediawiki/extensions/TimedMediaHandler@master] NewMwEmbedResourceManager: Remove discovery of '*.config.php' files

https://gerrit.wikimedia.org/r/452987

Change 452993 had a related patch set uploaded (by Krinkle; owner: Krinkle):
[mediawiki/extensions/TimedMediaHandler@master] NewMwEmbedSupport: Remove 'messageDir' option

https://gerrit.wikimedia.org/r/452993

Change 452965 merged by jenkins-bot:
[mediawiki/extensions/TimedMediaHandler@master] Move simple module registration from hooks to extension.json

https://gerrit.wikimedia.org/r/452965

Change 452973 merged by jenkins-bot:
[mediawiki/extensions/TimedMediaHandler@master] NewMwEmbedResourceManager: Remove unused 'messageFile' option

https://gerrit.wikimedia.org/r/452973

Change 452974 merged by jenkins-bot:
[mediawiki/extensions/TimedMediaHandler@master] NewMwEmbedResourceManager: Remove indirection around module directories

https://gerrit.wikimedia.org/r/452974

Change 452978 merged by jenkins-bot:
[mediawiki/extensions/TimedMediaHandler@master] NewMwEmbedResourceManager: Register 'mw.TimedText.loader' explicitly

https://gerrit.wikimedia.org/r/452978

Change 452987 merged by jenkins-bot:
[mediawiki/extensions/TimedMediaHandler@master] NewMwEmbedResourceManager: Remove discovery of '*.config.php' files

https://gerrit.wikimedia.org/r/452987

Change 453167 had a related patch set uploaded (by Krinkle; owner: Jforrester):
[mediawiki/extensions/TimedMediaHandler@master] Explicitly list modules' message keys, rather than compute them

https://gerrit.wikimedia.org/r/453167

Change 452993 merged by jenkins-bot:
[mediawiki/extensions/TimedMediaHandler@master] NewMwEmbedResourceManager: Remove non-standard 'messageDir' option

https://gerrit.wikimedia.org/r/452993

Krinkle removed a project: Patch-For-Review.

Yes! Thank you.

Krinkle updated the task description. (Show Details)