Page MenuHomePhabricator

Rewrite edit checks to use per-node cache
Closed, ResolvedPublic5 Estimated Story Points

Description

At present, most edit checks recheck the modified parts of the document repeatedly (roughly speaking, every time the document is updated). In suggestion mode they will recheck the whole document on the same basis. For a long article, with many checks operating, this will have an unacceptable performance impact, particularly on low-powered mobile devices.

The per-node cache from T415297 gives a way to avoid the vast majority of this rechecking in a typical edit scenario. It should be suitable for optimizing many of our existing checks.

Acceptance criteria

The following checks use the per-node cache:

  • Add reference Won't rewrite for now, as there is complex logic present
  • Convert reference Won't rewrite for now, as it depends on the internal list, not the paragraph
  • Disambiguation
  • External link
  • Fake headings
  • Image caption Won't rewrite for now, as it applies on save only
  • Redirect
  • Required template params Won't rewrite for now, as it applies outside paragraphs
  • Tone Won't rewrite for now, as it already uses its own custom caching (memoization)
  • Text match Won't rewrite for now, as there is complex logic present, and also some custom caching
  • Year link

Event Timeline

Change #1250078 had a related patch set uploaded (by Divec; author: Medelius):

[mediawiki/extensions/VisualEditor@master] WIP: Refactor ExternalLinkEditCheck to use per-node cache

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

Change #1264043 had a related patch set uploaded (by Divec; author: Divec):

[mediawiki/extensions/VisualEditor@master] Refactor YearLinkEditCheck to use per-node cache

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

Change #1264634 had a related patch set uploaded (by Divec; author: Divec):

[mediawiki/extensions/VisualEditor@master] Refactor FakeHeadingEditCheck to use per-node cache

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

dchan updated the task description. (Show Details)
dchan set the point value for this task to 5.
dchan updated the task description. (Show Details)
dchan updated the task description. (Show Details)

Change #1277261 had a related patch set uploaded (by Divec; author: Divec):

[mediawiki/extensions/VisualEditor@master] Refactor DisambiguationEditCheck to use per-node cache

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

Change #1277262 had a related patch set uploaded (by Divec; author: Divec):

[mediawiki/extensions/VisualEditor@master] Refactor RedirectEditCheck to use per-node cache

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

Change #1250078 merged by jenkins-bot:

[mediawiki/extensions/VisualEditor@master] Refactor ExternalLinkEditCheck to use per-node cache

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

Change #1264043 merged by jenkins-bot:

[mediawiki/extensions/VisualEditor@master] Refactor YearLinkEditCheck to use per-node cache

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

Change #1264634 merged by jenkins-bot:

[mediawiki/extensions/VisualEditor@master] Refactor FakeHeadingEditCheck to use per-node cache

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

Change #1277261 merged by jenkins-bot:

[mediawiki/extensions/VisualEditor@master] Refactor DisambiguationEditCheck to use per-node cache

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

Change #1277262 merged by jenkins-bot:

[mediawiki/extensions/VisualEditor@master] Refactor RedirectEditCheck to use per-node cache

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