Help:Extension:PerformanceInspector

The PerformanceInspector extension collect performance related information from different parts of MediaWiki for a specific article and present them to the user.

The inspector groups metrics into three different categories:
 * 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. If an image is large, you can check that the DPI is right, that the width/height is ok and that the image is compressed.

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 follow the instruction in template limits on how to make your templates parsing faster.

Resource Loader 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 when the page is rendered. You can check that the modules looks sane (only load ones that are used by the page).

You can also see how much of the CSS that are loaded that are actually used. You can also see which CSS expressions that are not used.