Page MenuHomePhabricator

mw.site should lazy-load the site stats
Closed, ResolvedPublic

Description

Scribunto's SiteLibrary class (mw.site in lua) currently calls multiple SiteStats methods when it's being registered. This causes an extra DB query (and an extra object cache lookup for SiteStats::numberingroup) for every request that uses Scribunto. Both of these are unnecessary in most of the cases, unless mw.site.stats is actually used.

This could be avoided by lazy-loading the stats table.