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.

How it works
You, as a user, should not worry about site performance. In most cases, there is little you can do to appreciably speed up or slow down the site's servers. But for articles there's things you can do and the Performance Inspector helps you to collect the metrics you need to figure out if there's something you can do.

Usage
You can try the feature by going to the "beta" section of your preferences (most wikis will show a "beta" link on the top-right area when you are logged-in), and enable the "Performance Inspector" feature.

When the Performance Inspector is enabled, you will get a link in the Tools section. Clicking that link will start the Performance Inspector that will collect and show metrics for the page.

Leave feedback
Please leave feedback at the talk page. It is extremely helpful to provide as much context information as you can when reporting issues with the feature.

Metrics
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

Actions
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. Improving these metrics makes the page faster for logged in users and each time the page needs to be regenerated for an anonymous user.

Actions
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 the size of each module, how much of the data that are loaded from local storage and the CSS usage.

Actions
Check that the module list looks sane (that the page only load the ones that are used by the page).

How much of the CSS that are loaded are actually used? You can view which CSS expressions that are not used.