Page MenuHomePhabricator

Investigate how visual diffs differ performance can be optimized
Open, Needs TriagePublic

Description

This task represents the work with investigating how the loading performance of the visual diffs differ can be improved.

This work is most immediately relevant to the work we are doing on the Toolbar v2: T229030. And more specifically, whether the visual diffs differ can be made to load quickly and reliably enough to potentially be shown to contributors by default, in the course of the edit flow.

Open questions

  • Do we know how quickly and reliably the visual diff differ loads in its current state?

Details

@DLynch outlined the following approaches to how we might go about doing this investigation:

  1. Currently this is built client-side on the main thread, which can therefore lock the browser up while it works. We should find ways to make this more performant.
  2. A cheap “fix” that might be worth investigating is seeing whether we can pack the entire thing into a Web Worker (what’s a web worker?), thus getting it off the main thread even if it doesn’t speed it up in any way.
  3. Alternately, we could find ways to split up the building of the diff so we can have the work happen on the main thread but in smaller pieces so any locking is less noticeable.
  4. If we can’t do either of these things, we have to work out what the edge cases are that are making it slow, and fix them.

Event Timeline

A cheap “fix” that might be worth investigating is seeing whether we can pack the entire thing into a Web Worker (what’s a web worker?), thus getting it off the main thread even if it doesn’t speed it up in any way.

I don't know whether/how much Visual Diffs rely on actual DOM nodes, but if they do this will be complicated/impossible, as the DOM isn't available in Web Workers.

A cheap “fix” that might be worth investigating is seeing whether we can pack the entire thing into a Web Worker (what’s a web worker?), thus getting it off the main thread even if it doesn’t speed it up in any way.

I don't know whether/how much Visual Diffs rely on actual DOM nodes, but if they do this will be complicated/impossible, as the DOM isn't available in Web Workers.

The diffing itself is done on the DM document and can be done without knowledge of DOM nodes. Building the diff view is done in DiffElement which isn't where the performance bottleneck is.

Removing task assignee due to inactivity, as this open task has been assigned for more than two years. See the email sent to the task assignee on February 06th 2022 (and T295729).

Please assign this task to yourself again if you still realistically [plan to] work on this task - it would be welcome.

If this task has been resolved in the meantime, or should not be worked on ("declined"), please update its task status via "Add Action… 🡒 Change Status".

Also see https://www.mediawiki.org/wiki/Bug_management/Assignee_cleanup for tips how to best manage your individual work in Phabricator.