Closed Bug 1613484 Opened 5 years ago Closed 5 years ago

[meta] The first network request is delayed too much after pressing enter in the URL bar (60ms-100ms on Moto G5)

Categories

(GeckoView :: General, defect)

All
Android
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 1608826

People

(Reporter: mstange, Unassigned)

Details

(Keywords: meta)

Here's a profile of what happens when I enter "google.com" in the Fenix URL bar and press enter, on the way to the first network request:
https://perfht.ml/2S2b567 (with sampling, easier to read but slowed down by profiler overhead)
https://perfht.ml/31yaXOD (without sampling, much less overhead)

This is in an existing about:blank tab. (I entered the URL about:blank manually.)

You can see that there's activity in the parent process a long time before the network chart in the parent process shows the network request starting.

I can see a number of problems:

  • The parent process knows about the URL we want to go to first, but it initiates the navigation through the content process which will bounce the network request back to the parent process. I think we do the same on desktop, so this is probably not straightforward to fix. However, maybe we can start a speculative connect in the parent and absorb some of the latency that way.
  • Bug 1613484: While the URL bar is focused, the browser has a different size. When enter is pressed, the browser is first resized to its regular size, and then the navigation is initiated.
  • This resize triggers at least two sets of restyle+reflow+paint in the content process (~24ms). These delay the initiation of the network request. (The first paint is from UpdateDimensions+RenderLayers, the second from UpdateEffects once the parent process has painted and knows how much of the browser is revealed on screen.)
  • AsyncOpen in the content process takes another 16ms before it propagates the request to the parent process. Half of that (8ms) seem to be spent notifying "http-on-opening-request" observers inside the content process.
Depends on: 1613488
Depends on: 1602318
Blocks: 1608826
No longer blocks: 1608826
Status: NEW → RESOLVED
Closed: 5 years ago
No longer depends on: 1602318, 1613488
Resolution: --- → DUPLICATE
Whiteboard: [qf]
You need to log in before you can comment on or make changes to this bug.