Page MenuHomePhabricator

Cache #ifexist results and do not count cache hits as "expensive" parser function calls
Closed, ResolvedPublic

Description

Currently, the parser considers all #ifexist calls as an "expensive" call. The problem occurs when you have a page which includes a template with a single #ifexist call several times. The page checked for existence is always the same but the total function call is multiplied by the number of times the template is included.

A solution would be to cache #ifexist results (and other expensive functions') and use them, without incrementing the expensive function call counter.


Version: unspecified
Severity: minor

Details

Reference
bz22808

Event Timeline

bzimport raised the priority of this task from to Low.Nov 21 2014, 11:04 PM
bzimport added a project: ParserFunctions.
bzimport set Reference to bz22808.

In fact, those repeated checks will be hitting Title::newFromText instead of making db calls.

All right.
So, it means they are already using a cache but still being considered as expensive.
In that case, just the expensive call counter needs no update.

Right. Although it may be tricky, since the cache is at a lower level thabn parserfunctions.

Related URL: https://gerrit.wikimedia.org/r/65828 (Gerrit Change Ie4dd9fd647dc79a2b31bc44ef8b6a641b54cfb78)

Change 65828 merged by Aaron Schulz:
(bug 22808) Don't count "expensive" calls for cached titles

https://gerrit.wikimedia.org/r/65828