Open Bug 1363399 (BackButton_Amazon) Opened 5 years ago Updated 4 years ago

Amazon back start: page navigation using back button is slow (dupe?)

Categories

(Core :: Layout, defect)

55 Branch
x86_64
Windows 10
defect
Not set
normal

Tracking

()

Tracking Status
platform-rel --- ?

People

(Reporter: afilip, Unassigned)

References

(Blocks 2 open bugs, )

Details

(Keywords: perf, Whiteboard: [qf:p3][QRC][QRC_Analyzed][platform-rel-Amazon])

Name: Firefox
Version: 55.0a1
Windows 10 64 bit
buildID: 20170508030204

Steps to reproduce:
1. Launch browser.
2. Fill amazon.com in Navigation Start, then press enter.
3. Search "Lord of the rings"
4. Scroll down and access a non add results
5. Play  movie Trailer
6. Record with Gecko Profile:
7. Click back button
8. Capture profile.
9. Share the profile.

Gecko profile:
https://perfht.ml/2pZSnyc
Assignee: nobody → nihsanullah
This Profile was recorded with the Acer hardware.

Name: Firefox
Version: 55.0a1
Windows 10 64 bit
buildID: 20170518030213


Steps to reproduce:
1. Launch browser.
2. Fill amazon.com in Navigation Start, then press enter.
3. Search "Lord of the rings"
4. Scroll down and access a non add results
5. Play  movie Trailer
6. Record with Gecko Profile:
7. Click back button
8. Capture profile.
9. Share the profile.

Gecko profile: https://perfht.ml/2q0vxDP
Whiteboard: [qrc]
Dear profile-analyzing engineer:

These profiles are from the same STR as bug 1362625. Please double check whether these profiles show any new hot spots that weren't seen in bug 1362625. If not, we can resolve this bug as a duplicate of bug 1362625.
Blocks: 1362625, QRC_FX57
Summary: STR Amazon -back button action → QRC: Amazon -back button action navigation is slow
Whiteboard: [qrc] → [QRC][QRC_NeedAnalysis]
Summary: QRC: Amazon -back button action navigation is slow → Amazon -back button action navigation is slow
No longer blocks: 1362625
Summary: Amazon -back button action navigation is slow → Amazon back start: page navigation using back button is slow (dupe?)
Assignee: nihsanullah → nobody
Jeff,  Please read comment 2 before you start analyzing the profiles from comment 1.  Thanks!
Assignee: nobody → jmuizelaar
Flags: needinfo?(jmuizelaar)
Here are my findings:
- Bit of Layout thrashing from Amazon scripts when loading the search result page out of network (we appear to be skipping bfcache for some reason), blocking initial paint of the search result page when going back
- Also note the beforeunload running in the Lord of the Rings page with the trailer that’s spending time trying to shut down the video for some reason
- A bunch of timers are firing immediately after painting the search result page, which is blocking interactivity.
Things that are within our power to fix:
- We could attempt to space out those timer runnables more and service user input events with higher priority? Quantum DOM work will help with this, actually. Input events are Tier 1!
- Our Web Compat team could reach out about the beforeunload and using requestIdleCallback instead of setTimeout
- Reflow markers in perf.html are suspect
  - Filed https://github.com/devtools-html/perf.html/issues/426
Flags: needinfo?(jmuizelaar)
Assignee: jmuizelaar → nobody
Whiteboard: [QRC][QRC_NeedAnalysis] → [QRC][QRC_Analyzed]
Probably need to file bugs for the suggestions at the end of comment 4 for DOM and webcompat.
It's worth noting that the bulk of the time in this profile is either in style or reflow so I'm moving it to layout.
Component: General → Layout
(In reply to Jeff Muizelaar [:jrmuizel] from comment #4)
> Here are my findings:
> - Bit of Layout thrashing from Amazon scripts when loading the search result
> page out of network (we appear to be skipping bfcache for some reason),
> blocking initial paint of the search result page when going back
> - Also note the beforeunload running in the Lord of the Rings page with the
> trailer that’s spending time trying to shut down the video for some reason
> - A bunch of timers are firing immediately after painting the search result
> page, which is blocking interactivity.
...
> - Our Web Compat team could reach out about the beforeunload and using
> requestIdleCallback instead of setTimeout

Mike, Jeff has identified some perf problems on amazon.com that Amazon may be able to avoid in their code. How would you like to track reaching out to Amazon?
Flags: needinfo?(miket)
Hey Chris, normally I'd ask Adam to handle that. But he's on PTO this week. If it's not urgent, we can wait, otherwise I'm happy to start conversations.
Flags: needinfo?(miket) → needinfo?(astevenson)
Given this is QF related... waiting a week doesn't seem great. ni? myself to start a thread on our ML.
Flags: needinfo?(miket)
Duplicate of this bug: 1362625
Alias: BackButton_Amazon
Depends on: 1357621, 1362626
Sent a message on our partner mailing list today.
Flags: needinfo?(miket)
> We could attempt to space out those timer runnables more and service user input events with higher priority?

We already force yielding between setTimeout() callbacks.  In FF54 and earlier the yield is forced after 5 callbacks are allowed to run consecutively.  In FF55+ we allow consecutive callbacks to run for up to 4ms and then force a yield after that.

Note, the 4ms yield threshold landed in bug 1343912 2 days after comment 1 profile was taken.  We may want to re-profile if that is significant here.

Also note, Quantum DOM will not really help here.  That is more about separating out different windows within the same process instead of relative priorities of different runnables within a single window.
platform-rel: --- → ?
Flags: needinfo?(astevenson)
Whiteboard: [QRC][QRC_Analyzed] → [QRC][QRC_Analyzed][platform-rel-Amazon]
[qf] per comment 9.
Whiteboard: [QRC][QRC_Analyzed][platform-rel-Amazon] → [qf][QRC][QRC_Analyzed][platform-rel-Amazon]
Whiteboard: [qf][QRC][QRC_Analyzed][platform-rel-Amazon] → [qf:p3][QRC][QRC_Analyzed][platform-rel-Amazon]
Keywords: perf
You need to log in before you can comment on or make changes to this bug.