Page MenuHomePhabricator

Gender cache is not filled (via Thanks\Hooks::generateThankElement)
Closed, ResolvedPublic

Description

Similarly to T367172: Watchlist formatter is doing a user edit count database query in every row of the result inspecting Special:Watchlist that has gotten quite slow recently shows that 13% of loading watchlist page is being spent on doing database query: https://performance.wikimedia.org/excimer/profile/0a96d7cc5babe7eb

XhGui says MediaWiki\Cache\GenderCache::doQuery is getting called 97 times in one request: https://performance.wikimedia.org/xhgui/run/symbol?id=6668463540e83c26e289c1da&symbol=MediaWiki%5CCache%5CGenderCache%3A%3AdoQuery the caching seems to be clearly broken.

Stacktrace:

grafik.png (722×942 px, 167 KB)

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript
Ladsgroup triaged this task as Medium priority.Tue, Jun 11, 1:06 PM
Ladsgroup updated the task description. (Show Details)
Ladsgroup moved this task from Triage to In progress on the DBA board.

Works when the content language distinct gender as LinkBatch prefills the GenderCache. But for languages without gender support the cache must not done any query.

LinkBatch::doGenderQuery skips the gender cache, as gender is not needed to get the namespace prefix of the title. But Thanks is using GenderCache::getGenderOf and that also query on en.

Since 012a387587d56e92542265c4d597806d5c629542 the thanks links seems to show on Special:Watchlist and does this query.

Change #1041764 had a related patch set uploaded (by Umherirrender; author: Umherirrender):

[mediawiki/extensions/Thanks@master] Add BatchLookups on HistoryPager and ChangesList

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

Change #1041764 merged by jenkins-bot:

[mediawiki/extensions/Thanks@master] Add BatchLookups on HistoryPager and ChangesList

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

Umherirrender renamed this task from Gender cache is not caching to Gender cache is not filled (via Thanks\Hooks::generateThankElement).Tue, Jun 11, 9:07 PM
Umherirrender closed this task as Resolved.
Umherirrender claimed this task.
Umherirrender removed a project: Patch-For-Review.