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.
Description
Details
Related Objects
Event Timeline
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
Change 411591 merged by jenkins-bot:
[VisualEditor/VisualEditor@master] Do less work when building the diff document
Change 413904 had a related patch set uploaded (by Jforrester; owner: Jforrester):
[mediawiki/extensions/VisualEditor@master] Update VE core submodule to master (d0fd0c9a6)
Change 413904 merged by jenkins-bot:
[mediawiki/extensions/VisualEditor@master] Update VE core submodule to master (e6b9330)
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: 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.