A while back we introduced display: none [1] to hide content in the DOM rather than stripping it from the HTML output.
We of course never measured the impact of this.
I'd like to propose we explore this avenue again in a controlled manner.
Given the navbox element can account for around 12% [1] this could be causing issues.
Hypothesis: Reducing the unnecessary HTML we send down the wire has more benefits than the extra cost on parsing and stripping newly saved content.
To measure:
- When a cookie is set / query string parameter is passed / for a given page strip any selector in this selector from the DOM before sending. Run tests on different connection speeds and report the difference in time to first paint under these two conditions.
There is evidence here: https://phabricator.wikimedia.org/T119797#1899560
In an ideal world we would want to allow lazy loading of stripped elements e.g. leave a link in their place to Special:MobileFragment/<page title>/<sha id>