Page MenuHomePhabricator

Cache php.getEntityStatements in mw.wikibase
Closed, ResolvedPublic

Description

Like we cache whole entities in Lua, we should also cache individual statements loaded via php.getEntityStatements, this is especially important as serializing Statements for Lua is fairly expensive.

Details

Related Gerrit Patches:
mediawiki/extensions/Wikibase : masterTrack mw.wikibase in memory statement cache misses
mediawiki/extensions/Wikibase : masterIn Lua cache mw.wikibase.getBestStatements/getAllStatements
mediawiki/extensions/Wikibase : masterGeneralize internal cache in mw.wikibase.lua

Event Timeline

hoo created this task.Fri, Oct 25, 3:18 PM
Restricted Application added a project: Wikidata. · View Herald TranscriptFri, Oct 25, 3:18 PM
Restricted Application added a subscriber: Aklapper. · View Herald Transcript

Change 546223 had a related patch set uploaded (by Hoo man; owner: Hoo man):
[mediawiki/extensions/Wikibase@master] Generalize internal cache in mw.wikibase.lua

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

Change 546224 had a related patch set uploaded (by Hoo man; owner: Hoo man):
[mediawiki/extensions/Wikibase@master] In Lua cache mw.wikibase.getBestStatements/getAllStatements

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

hoo claimed this task.Fri, Oct 25, 4:23 PM

Change 546294 had a related patch set uploaded (by Hoo man; owner: Hoo man):
[mediawiki/extensions/Wikibase@master] Track mw.wikibase in memory statement cache misses

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

Change 546223 merged by jenkins-bot:
[mediawiki/extensions/Wikibase@master] Generalize internal cache in mw.wikibase.lua

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

Change 546224 merged by jenkins-bot:
[mediawiki/extensions/Wikibase@master] In Lua cache mw.wikibase.getBestStatements/getAllStatements

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

Change 546294 merged by jenkins-bot:
[mediawiki/extensions/Wikibase@master] Track mw.wikibase in memory statement cache misses

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

Addshore triaged this task as Normal priority.Tue, Oct 29, 10:40 AM

@hoo now that this is all merged and deployed, how is it looking? :) can we close?

hoo added a comment.Tue, Nov 5, 9:34 PM

@hoo now that this is all merged and deployed, how is it looking? :) can we close?

Yes, I think so. According to the new "Wikibase lua getEntityStatements cache (daily average) " panel on the wikidata-lua-function-usage dashboard, we achieve more than decent hit rates for both Wikipedia and many sister projects, and exceptional hit rates for commons (way more hits than cache misses).