NewPP parser report

From MediaWiki.org
(Redirected from PP Report)
Jump to: navigation, search

NewPP is an abbreviation for "New PreProcessor" (new at the time of Tim Starling's 2008 parser rewrite for MediaWiki 1.12, that is). One is most likely to find it at the bottom of the HTML source of wiki pages, referring to the preprocessor report that contains statistics on what resources were used to render the page, and usage of various parsing-related quotas (such as number of expensive calls, or number of preprocessor tree nodes).

On a Wikimedia site it will look something like this:

<!-- 
NewPP limit report
Parsed by mw1252
Cached time: 20170617200920
Cache expiry: 2592000
Dynamic content: false
CPU time usage: 0.100 seconds
Real time usage: 0.153 seconds
Preprocessor visited node count: 501/1000000
Preprocessor generated node count: 0/1500000
Post‐expand include size: 50861/2097152 bytes
Template argument size: 121/2097152 bytes
Highest expansion depth: 9/40
Expensive parser function count: 4/500
Lua time usage: 0.032/10.000 seconds
Lua memory usage: 1.73 MB/50 MB
-->

followed by a per-template transclusion expansion time report and a debug message with the parser cache key.

See w:Wikipedia:Template limits for details on what the lines mean.

User script to make the report visible[edit]

The following snippet (to be stored in custom user JavaScript) will make the NewPP parser report appear on every content page at the bottom:

$('#mw-content-text').contents().filter(function() {
  return this.nodeType == 8 && /Saved|NewPP/.test(this.data);
}).replaceWith(function() { 
  return $('<pre>', { dir: 'ltr' } ).text(this.data); 
});

See also[edit]