Page MenuHomePhabricator

Edit page metadata is very slow to load from the Action API, slowing down VisualEditor initialization
Open, Needs TriagePublic

Description

As shown in T206228, we usually spend more time generating page edit metadata than loading the actual page HTML. Page metadata includes

  • Edit notices
  • Edit checkboxes (minor edit etc.)
  • Used templates
  • Red-link information
  • Latest revision and timestamp info

Firstly we should investigate whether this is a regression, or something we've just not noticed before.

Secondly, none of this data should block the loading of the editor, so we should be able to make the time to interactive lower in VE.

Event Timeline

Esanders created this task.Nov 8 2018, 5:23 PM
Restricted Application added a project: VisualEditor. · View Herald TranscriptNov 8 2018, 5:23 PM
Restricted Application added a subscriber: Aklapper. · View Herald Transcript
Jdforrester-WMF renamed this task from Edit metadata is very slow to load to Edit page metadata is very slow to load from the Action API, slowing down VisualEditor.Nov 8 2018, 7:58 PM
Schnark added a subscriber: Schnark.Nov 9 2018, 9:06 AM
Esanders renamed this task from Edit page metadata is very slow to load from the Action API, slowing down VisualEditor to Edit page metadata is very slow to load from the Action API, slowing down VisualEditor initialization.Nov 11 2018, 12:18 PM

Change 473198 had a related patch set uploaded (by Esanders; owner: Esanders):
[mediawiki/extensions/VisualEditor@master] Separate document HTML promise from edit metadata promise

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

JTannerWMF moved this task from To Triage to Q4 on the VisualEditor board.Dec 19 2018, 7:03 PM
Esanders updated the task description. (Show Details)Feb 22 2019, 5:53 PM

It looks like a lot of this slowdown comes from building the red-link cache, which we should've dropped 18 months ago when it was upstreamed to Parsoid (T64803).

Change 492358 had a related patch set uploaded (by Esanders; owner: Esanders):
[mediawiki/extensions/VisualEditor@master] ApiVisualEditor: Remove red-link cache warming

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

Change 492366 had a related patch set uploaded (by Esanders; owner: Esanders):
[mediawiki/extensions/VisualEditor@master] ApiVisualEditor: Separate out templatesUsed from metadata

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

The two later patches may make the metadata requests fast enough that the first patch is less urgent. Let's see how it affects the real-world numbers.

Change 492358 merged by jenkins-bot:
[mediawiki/extensions/VisualEditor@master] ApiVisualEditor: Remove red-link cache warming

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

Change 492366 merged by jenkins-bot:
[mediawiki/extensions/VisualEditor@master] ApiVisualEditor: Separate out templatesUsed from metadata

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

matmarex moved this task from Incoming to In progress on the VisualEditor (Current work) board.
matmarex added a subscriber: matmarex.

Next steps: Ed to find out if these two patches make it fast enough so that the first patch becomes unnecessary.

Cirdan added a subscriber: Cirdan.Mar 3 2019, 10:01 AM
Esanders claimed this task.Mar 13 2019, 5:54 PM

Re-running the featured-article tests from T206228, metadata and page html now take about roughly the same time. The issue is now less severe, but there are probably more benefits to be had by not blocking on metadata at all.

Here is a 7-day rolling overage of 5th centile load times:


and 50th centile / median:

Given that the metadata request is still block in some cases (especially on shorter articles, or when loading the page a second time) we should go ahead and try and merge the metadata promise separation patch.

Change 473198 had a related patch set uploaded (by Esanders; owner: Esanders):
[mediawiki/extensions/VisualEditor@master] Separate document HTML promise from edit metadata promise

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

I guess the last patch is still waiting for review.