Extension:PerformanceInspector

The PerformanceInspector extension collect performance related information from different parts of MediaWiki for a specific article and present them to the user. You can try out the extension on beta (look for Performance inspector in the Tools section).

Metrics
The current version collect three different categories of metrics: Lets add more categories in the future. The main goal with the metrics is that you as a user can change things yourself to make a page faster.
 * Image metrics
 * Parser profiling metrics
 * Module metrics

Image metrics
The performance inspector collects the size of all images used on a page and shows you the individual sizes. The image size for a page is interesting from a cost perspective for users: Users that pays for bandwidth or has a data limit of how many bytes they can use in month, will save money if we make sure we don't send extra bytes to them.

In parts of the world data is expensive and the inspector wants to highlight the cost for users a la https://whatdoesmysitecost.com/ and that is happening in https://phabricator.wikimedia.org/T145123

The inspector flags for images that are larger than one megabyte, but it is you as a user of the inspector that will take the decision if the image can be smaller. Too large images can be using the wrong DPI, be much wider than we display or uncompressed.

Parser profiling metrics
The parser profiling metrics comes from when the backend server parses the page (picking up the same parser metrics as you can see if you do view source of a page and look for wgPageParseReport). These metrics are collected when the server parser the page, then the page is cached in Varnish for non authenticated users, meaning improving these metrics makes the page faster for logged in users and each time the page needs to be regenerated for an anonymous user.

In this section you can see what templates are used to to generate the page and how long time is spent in each template. You can read more about Scribuntu/Lua templates and about template limits.

Module metrics
The module metrics is the same as you can fetch from the Javascript console running mw.loader.inspect. These are the modules that the ResourceLoader loads to be able to create the page. Here you can check that the modules looks sane (only load ones that are used).

You can also see how much of the CSS that are loaded that are actually used. That part needs some fine tuning (so you are able to see exact CSS that aren't used, so you more easy can see what you can remove).

Invoke the Performance inspector
You can find the link to the Performance inspector is in the Tools section when the extension is installed.