Page MenuHomePhabricator

Instrument mediawiki to generate metrics for Scribunto / Lua usage on a page
Open, Needs TriagePublic

Description

It would be useful to understand how much time we are spending in Scribunto / Lua for rendering pages.

Anecdotally, clicking around a bunch of pages and looking at limit reports, it looks like 30%-60% of page rendering time is spent in Lua code for the legacy parser. And for Parsoid, the relative time is different because Parsoid is slower relative to the legacy parser.

But, having a grafana dashboard where we can track these numbers over time would also be useful in figuring out regressions, etc. But, more importantly, these metrics can inform potential infrastructure-level work for performance improvements. While editors and module authors could potentially profile their code and optimize it, it is unlikely that we can expect this work to happen at scale across the large set of Lua modules we have. Infrastructure-level performance improvements can yield a lot more benefits. For example, I am curious if there is any value in enabling LuaJIT for Scribunto. That would be a non-trivial project and comes with some constraints (ex: LuaJIT is right now stuck on Lua 5.1 and it is unclear if / when they might support newer versions of Lua). So, before we even do any experimentation there, it would be useful to get some baseline numbers to inform any performance work / hypothesis related to this.