Manual talk:$wgExpensiveParserFunctionLimit

From MediaWiki.org
Jump to: navigation, search

Which functions?[edit]

Besides PAGESINCATEGORY, and #ifexist:, are there any other expensive parser functions? And if there are, should they be listed on this page? Timeroot 02:32, 24 January 2009 (UTC)

Magic word for this variable?[edit]

Is there a {{MAGICWORD}} that displays $wgExpensiveParserFunctionLimit (the way, e.g., {{SERVER}} displays $wgServer)?—msh210@enwikt 21:19, 12 February 2009 (UTC)

Nikerabbit has informed me on IRC that the answer is no.—msh210@enwikt 20:09, 17 February 2009 (UTC)

Question[edit]

Where is the page with the variable on it?--Launchballer 11:12, 29 August 2009 (UTC)

What if logically not executed[edit]

Does the counter add one when the expensive parser function is logically not executed? E.g. when used within a cheap conditional function like this:

{{#ifeq: 1 | 1 | go ahead | {{#ifexist Help:Citing sources | blue | red }} }}

If it does add, I might program differently (for other reasons, including simplicity). If not, it might be worth complicating the program (by doing more cheap conditions in outer functions). -DePiep 13:34, 27 August 2010 (UTC) Improving example, sp -DePiep 13:53, 27 August 2010 (UTC)

Testing: go ahead
It does not, as you can see in the html-source of this section: Preprocessor node count: 8/1000000 Post-expand include size: 8/2048000 bytes Template argument size: 0/2048000 bytes Expensive parser function count: 0/500.--Patrick 11:27, 6 September 2010 (UTC)
The syntax above is wrong, so it is not a valid test.
Let's try again, and also use a magic word to ensure that the test is not affected by any optimisation of an always-true expression:
 ''{{#ifeq: {{NAMESPACE}} | Manual talk | go ahead | {{#ifexist:Help:Citing sources | blue | red }} }}''
Testing: go ahead
And the resulting source code still shows zero expensive functions:
<!-- 
NewPP limit report
Preprocessor node count: 18/1000000
Post-expand include size: 27/2048000 bytes
Template argument size: 0/2048000 bytes
Highest expansion depth: 3/40
Expensive parser function count: 0/500
-->
So the previous conclusion remains correct: a function only counts towards the limit if it is in the applicable logic path.
Richardguk (talk) 13:49, 22 August 2012 (UTC)

Multiple occurences of the expensive parser function calls with the same parameter[edit]

Expensive parser calls on the same page but that are using the same costly parameters are counted only once, because these parser functions are actually executed only once and their result is cached. For example:

{{#ifexist:{{FULLPAGENAME}}|1|2}} {{#ifexist:{{FULLPAGENAME}}|3|4}}

will count only as one expensive parser call (both existence tests will return true and will display "1 3", unless there are more tests before these two that have already exhausted the limit and that did not already tested the existence of the given pagename, in that case both tests will return false and will display "2 4", if you create a page containing the code above and look at its HTML source, you'll see this generated HTML comment with these statistics :

<!-- 
NewPP limit report
...
Preprocessor visited node count: 7/1000000
Preprocessor generated node count: 0/1500000
Post‐expand include size: 64/2097152 bytes
Template argument size: 0/2097152 bytes
Highest expansion depth: 3/40
Expensive parser function count: 1/500
Number of Wikibase entities loaded: 0
-->

86.221.33.59 17:41, 12 November 2015 (UTC)

It should have less than 100 calls, there are now 178 calls.[edit]

If you get such a mistake for Lua. LocalSettings.php file "$wgExpensiveParserFunctionLimit = '1000';" Add the code. The problem is solved. --İncelemeelemani (talk) 20:01, 9 January 2018 (UTC)