Page MenuHomePhabricator

Avoid eager loading of mediawiki.searchSuggest scripts and dependencies
Closed, ResolvedPublic


Idea from @Fomafix at

The module 'mediawiki.searchSuggest' has dependencies on the following modules:

  • jquery.getAttrs
  • jquery.highlightText
  • jquery.suggestions
  • mediawiki.searchSuggest
  • user.defaults

These have a combined size of 24 KB (24,613 bytes, minified but before gzip)
These modules must not already get loaded on page load. Some modules may
already get loaded on page load by other dependencies from extensions.

Looks like this could make a pretty big win. As Fomafix says, some of these dependencies will still be pulled in by other code, but worth exploring.


Related Gerrit Patches:

Event Timeline

Krinkle created this task.Sep 24 2019, 3:44 AM
Restricted Application added a project: Discovery-Search. · View Herald TranscriptSep 24 2019, 3:44 AM

Change 507067 had a related patch set uploaded (by Krinkle; owner: Fomafix):
[mediawiki/core@master] Lazy load the module 'mediawiki.searchSuggest'

Change 507067 merged by jenkins-bot:
[mediawiki/core@master] Lazy load the module 'mediawiki.searchSuggest'

Fomafix claimed this task.Mon, Jan 13, 5:29 PM
Krinkle closed this task as Resolved.Wed, Jan 15, 3:03 AM

Dashboard: resourceloader-module

  • Lowered from 1.8x - 3.1x per second, to 0.3x - 0.8x per second.

Dashboard: webpagereplay-drilldown

  • JS transfer size: 230 kB -> 222 kB

The spikes correlate to CentralNotice banners being loaded. Comparison is between the stable baseline from the weeks prior and the current lowest value which represents test runs where no banner was loaded.

I wasn't able to find any notable change in other RUM and synthetic metrics. Various metrics did come down a little bit not enough to be confidently attributable to any one change. I suppose we can keep going in the parent task.