Page MenuHomePhabricator

Reduce number of RL modules
Closed, ResolvedPublic

Description

We have an obscene number of RL modules; I count 1196 on enwiki right now. I broke these down into groups based on prefix, so we can look at where the biggest problems are:

1145 jquery
2 31 jquery.ui
3 21 jquery.valueview
4 14 jquery.effects
5 8 jquery.wikiEditor
6 4 jquery.uls
7 3 jquery.wikibase
8 2 jquery.util
9 2 jquery.qunit
10 60 (other)
11143 ext.geshi
12126 mediawiki
13 26 mediawiki.special
14 15 mediawiki.action
15 8 mediawiki.ui
16 8 mediawiki.api
17 7 mediawiki.legacy
18 6 mediawiki.page
19 6 mediawiki.language
20 5 mediawiki.skinning
21 4 mediawiki.template
22 3 mediawiki.messagePoster
23 3 mediawiki.libs
24 3 mediawiki.htmlform
25 2 mediawiki.jqueryMsg
26 2 mediawiki.debug
27 28 (other)
28103 wikibase
29 51 wikibase.serialization
30 33 wikibase.datamodel
31 7 wikibase.client
32 6 wikibase.api
33 6 (other)
3479 mobile
3566 ext.gadget
3651 mmv
3745 schema
3833 ext.math
3930 mw
4029 skins
4127 ext.visualEditor
4224 ext.gather
4321 ext.uls
4421 ext.flow
4521 ep
4619 oojs-ui
4711 ext.pageTriage
4811 ext.guidedTour
4911 ext.centralauth
509 util
519 ext.MassMessage
528 ext.gettingstarted
538 ext.centralNotice
547 ext.wikiEditor
556 user
566 ext.echo
575 ext.wikiLove
584 valueParsers
594 valueFormatters
604 ext.thanks
614 ext.globalCssJs
624 ext.collection
634 ext.codeEditor
644 ext.abuseFilter
653 ext.wikihiero
663 ext.templateDataGenerator
673 ext.scribunto
683 ext.MWOAuth
693 ext.imageMetrics
703 ext.flaggedRevs
713 ext.eventLogging
723 ext.confirmEdit
733 ext.betaFeatures
743 dataValues
752 unicodejs
762 time
772 ext.wikimediaEvents
782 ext.securepoll
792 ext.inputBox
802 ext.graph
812 ext.categoryTree
822 ext.apifeatureusage
832 easy-deflate
842 dataTypes
851 zerobanner
861 tablet
871 Spinner
881 site
891 rangy
901 rangefix
911 qunit
921 pdfhandler
931 papaparse
941 oojs
951 noscript
961 moment
971 json
981 iScroll
991 globeCoordinate
1001 fullScreenApi
1011 filepage
1021 ext.wikimediamessages
1031 ext.wikimediaBadges
1041 ext.vipsscaler
1051 ext.tmh
1061 ext.TemplateSandbox
1071 ext.templateData
1081 ext.rtlcite
1091 ext.popups
1101 ext.nuke
1111 ext.navigationTiming
1121 ext.interwiki
1131 ext.GlobalUserPage
1141 ext.dismissableSiteNotice
1151 ext.disambiguator
1161 ext.citoid
1171 ext.citeThisPage
1181 ext.cite
1191 ext.cirrusSearch
1201 ext.checkUser
1211 ext.campaigns
1221 ext.babel
1231 ext.apiSandbox
1241 es5-shim
1251 embedPlayerIframeStyle
1261 dom-level2-shim
1271 dependencies
1281 Base64

Main culprits IMO:

  • ext.geshi has one module per syntax highlighting language. I'm not sure how avoidable that is; maybe we can come up with a way to do parameterized modules here, or maybe we can make disable most of the 142 supported languages in wmf-config
  • wikibase appears to have one module per class, plus foo.__namespace modules; there could be some easy gains here by combining modules whose separation isn't needed in practice
  • The same pattern, at a smaller scale, appears to be happening in mmv (MultimediaViewer)
  • There are 79 mobile.* modules; there doesn't seem to be a clear pattern or one clear offender, but I suppose we could ask the mobile web team to see if things can be trimmed there

Smaller things:

  • There are 61 modules with 'style' in their name; not all of them are addModuleStyles-only, but some of them are, and those we could avoid listing in the startup module
  • We could audit to see if all 45 schema modules are in use
  • I'm unconvinced that extensions like VE, Gather, ULS, Flow and EducationProgram really need 20-30 modules each, those could be audited and trimmed too

Event Timeline

Catrope raised the priority of this task from to Needs Triage.
Catrope updated the task description. (Show Details)
Catrope added subscribers: Catrope, ori, Krinkle.

ext.geshi has one module per syntax highlighting language. I'm not sure how avoidable that is

It is very much avoidable. It must be. The current implementation of Geshi is unnecessarily complex and verbose. Any sane syntax highlighter separates grammar and styling. Geshi does not. See T85794 for various ideas.

There are 61 modules with 'style' in their name; not all of them are addModuleStyles-only, but some of them are, and those we could avoid listing in the startup module

This is blocked by T92459 and associated tasks, which will make it possible to add "state:ready" calls for style modules in the html. However excluding styles-only modules from the startup module is probably not an option. They are still eligible for lazy-loading and depending on. E.g. loading diff styles in VE.

Krinkle triaged this task as Medium priority.Jun 10 2015, 10:27 PM
Krinkle moved this task from Tag to Next-up on the Performance Issue board.
Krinkle set Security to None.

There are 61 modules with 'style' in their name; not all of them are addModuleStyles-only, but some of them are, and those we could avoid listing in the startup module

This is blocked by T92459 and associated tasks, which will make it possible to add "state:ready" calls for style modules in the html. However excluding styles-only modules from the startup module is probably not an option. They are still eligible for lazy-loading and depending on. E.g. loading diff styles in VE.

Yeah, I didn't mean style-only modules, but specifically modules that are only ever used with addModuleStyles(). That's probably too complex to track and too small to be helpful, though.

Updated overview (from enwiki)

469	"ext"
	82	"gadget"
	57	"cx"
	33	"visualEditor"
	21	"kartographer"
	20	"uls"
	18	"RevisionSlider"
	17	"centralNotice"
	15	"echo"
	14	"tmh"
	14	"centralauth"
	13	"guidedTour"
	11	"pageTriage"

168	"mediawiki"
	33	"special"
	16	"action"
	12	"api"

146	"jquery"
	32	"ui"
	24	"valueview" # Wikidata
	14	"effects"

104	"wikibase"
	51	"serialization"
	33	"datamodel"
	8	"client"
	6	"api"

70	"mobile"
	6	"app"
	4	"search"
	4	"special"

42	"schema"
	# EventLogging

38	"mw"
	# CX and TMH

27	"skins"
	21	"minerva"
	3	"vector"

21	"ep"

19	"oojs-ui"

9	"mmv"

9	"util"
	# Wikidata
Gilles claimed this task.