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.

Event Timeline

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'

Dashboard: resourceloader-module

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

build.png (1×2 px, 171 KB)

Dashboard: webpagereplay-drilldown

  • JS transfer size: 230 kB -> 222 kB

jstransfer.png (851×1 px, 74 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.