Page MenuHomePhabricator

Investigate the performance of visual diffs when user pastes a huge, complex article into another one
Closed, ResolvedPublic8 Story Points

Description

In the case where a user pastes in another huge article or makes an extremely large number of complex changes throughout a large document, the visual diff can sometimes take a long time to calculate or cause the user’s browser to freeze. This was reported by a user who pasted 1,000+ lines of complex wikitext into another article. We should investigate this situation.

Event Timeline

Deskana created this task.Feb 12 2018, 1:40 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptFeb 12 2018, 1:40 PM
Elitre added a subscriber: Elitre.Feb 12 2018, 2:05 PM
Esanders triaged this task as Low priority.Feb 12 2018, 7:49 PM

In the example given, a lot of the time was spent putting the visual diff document html together. The problem is, we make the html from the visual editor linear data, and given the way that works, <del> and <ins> have to be added as annotations to each character, so when we are dealing with several hundred paragraphs, all inserted or deleted in their entirety, this takes a long time. One way round this is to bypass the normal visual editor converter when making html for the diff document, so we can add those tags directly.

Change 411591 had a related patch set uploaded (by Tchanders; owner: Tchanders):
[VisualEditor/VisualEditor@master] Do less work when building the diff document

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

Deskana set the point value for this task to 8.
Deskana moved this task from TR6: Visual diffs to Current work on the VisualEditor board.
Deskana edited projects, added VisualEditor (Current work); removed VisualEditor.
TheDJ awarded a token.Feb 19 2018, 2:11 PM

Change 411591 merged by jenkins-bot:
[VisualEditor/VisualEditor@master] Do less work when building the diff document

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

Change 413904 had a related patch set uploaded (by Jforrester; owner: Jforrester):
[mediawiki/extensions/VisualEditor@master] Update VE core submodule to master (d0fd0c9a6)

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

Change 413904 merged by jenkins-bot:
[mediawiki/extensions/VisualEditor@master] Update VE core submodule to master (e6b9330)

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

Deskana closed this task as Resolved.Feb 26 2018, 11:31 AM

The above patch should significantly reduce this problem.

Alsee added a subscriber: Alsee.Apr 27 2018, 5:17 AM

Visual Diff is still completely failing on large diffs. Tested in three browsers on two computers.

  • Use 2017 Editor at EnWiki article United States.
  • Search and replace all instances of United States with U.S.
  • View Wikitext diff. Works.
  • Try to view visual diff. Fails. The javascripts maxes out the CPU for a while, and may generate multiple browser warnings of slow/unresponsive script. I tried waiting over of 6 minutes in all tests, and I waited over 20 minutes in some cases. The visual diff never came up at all.
Alsee renamed this task from Investigate the performance of visual diffs when user pastes a huge, complex article into another one to Investigate the performance of visual diffs for large diffs.Apr 27 2018, 5:19 AM
Alsee reopened this task as Open.

@Alsee: Please file separate tasks for separate specific issues. This task is about investigating which has happened (whether it was "enough investigation" depends on personal points of views, I guess). Extending the task's scope to have one catch-all task for performance issues with visual diffs is not feasible.
Thanks for your understanding.

Aklapper renamed this task from Investigate the performance of visual diffs for large diffs to Investigate the performance of visual diffs when user pastes a huge, complex article into another one.Apr 27 2018, 9:22 AM
Aklapper closed this task as Resolved.