Closed Bug 1363695 Opened 5 years ago Closed 3 years ago

Amazon search start: search result loading is slow

Categories

(Core :: Layout, defect, P3)

55 Branch
x86_64
Windows 10
defect

Tracking

()

RESOLVED INCOMPLETE
Tracking Status
platform-rel --- -

People

(Reporter: afilip, Unassigned)

References

(Blocks 2 open bugs, )

Details

(Keywords: perf, Whiteboard: [qf:investigate][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. Click back button
7. Record with Gecko Profile:(only the second access is captured)
8. Click on the second non-ad result: book
9. Capture profile.
10. Share the profile.


Profile
https://perfht.ml/2q5o47r
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. Click back button
7. Record with Gecko Profile:(only the second access is captured)
8. Click on the second non-ad result: book
9. Capture profile.
10. Share the profile.


 
Gecko Profile: https://perfht.ml/2q0ykwA
Blocks: QRC_FX57
Summary: STR Amazon -second non add result access → QRC: Amazon -second non-ad search result access is slow
Whiteboard: [QRC][QRC_NeedAnalysis]
Summary: QRC: Amazon -second non-ad search result access is slow → Amazon search result loading is slow
Assignee: nihsanullah → nobody
Summary: Amazon search result loading is slow → Amazon search start: search result loading is slow
Sotaro, Please do an analysis of the profile in comment 1. Thanks!
Assignee: nobody → sotaro.ikeda.g
I checked the profile, but I could not find useful information:( The context of the bug is not clear yet for me. Filip Andrei, can you answer the following questions?

- How slow was it to load the search result?
- What was your pc to test?
- The loading is slow without profiling(without step 7 ,9 and 10 in comment 0)?
- Does the problem happens without "5. Play  movie Trailer"in comment 0?
- Does the problem happens with another pcs?
- Does the problem happens with Firefox 54 and Firefox 56?
Flags: needinfo?(afilip)
In profile in comment 1, there are long(563.88ms) event processing delay on tab thread. During it, content 2 main thread seemed very busy for re-styling and reflow.
Hi Sotaro,


Each week we run a benchmark test and we compare browser responsiveness between Firefox and Chrome and the procedure is to log bugs and gather profiles for all the scenarios that are slower than Chrome  according to release criteria .Benchmark is runned only on the latest nightly build and we have a tracked history that you can find here https://docs.google.com/spreadsheets/d/1UMsy_sZkdgtElr2buwRtABuyA3GY6wNK_pfF01c890A/edit?ts=58fd8bae#gid=1467038243 .

What was your pc to test?
Reference System:Acer Aspire E
Flags: needinfo?(afilip)
(In reply to Filip Andrei from comment #5)
> 
> What was your pc to test?
> Reference System:Acer Aspire E

I used Lenovo P90.
(In reply to Sotaro Ikeda [:sotaro] from comment #4)
> In profile in comment 1, there are long(563.88ms) event processing delay on
> tab thread. During it, content 2 main thread seemed very busy for re-styling
> and reflow.

From the profile, I did not find the problem around graphics.
Assignee: sotaro.ikeda.g → nobody
Hi Jonathan, could you help to follow Sotaro's investigation from comment 4? Thanks.
Assignee: nobody → jfkthame
Flags: needinfo?(jfkthame)
It looks like style computation is taking a lot of time here; particularly RuleHash::EnumerateAllRules seems to stand out. :heycam, is this something where Stylo will likely help us out?
Flags: needinfo?(jfkthame) → needinfo?(cam)
Yes, EnumerateRules is basically the top level function of selector matching.  It looks like the profile is restyling big subtrees, which is Stylo's forte.
Flags: needinfo?(cam)
Component: General → Layout
Filip, can you re-test this with a current Nightly with stylo enabled, and see if there has been a useful improvement? Thanks.
Flags: needinfo?(afilip)
Hi Jonathan!

Filip is on PTO for 2 weeks. In this case I provided a new gecko profile that you can find it below.

This test was performed with Stylo enabled and from what I saw the old profile is pretty much the same as the new one.   

This Profile was recorded with the Acer hardware.

Name: Firefox
Version: 57.0a1
Windows 10 64 bit
buildID: 20170808114032

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. Click back button
7. Record with Gecko Profile:(only the second access is captured)
8. Click on the second non-ad result: book
9. Capture profile.
10. Share the profile.


 
Gecko Profile: https://perfht.ml/2fsM5UM
Flags: needinfo?(afilip)
Priority: -- → P3
Hi Jonathan, could you help the profiling? Thanks.
Flags: needinfo?(jfkthame)
AFAICS, the main thing going on here is that a lot of JS is running, and doing things that trigger layout flushes (typically by accessing properties like offsetWidth and scrollWidth of elements).

https://perf-html.io/public/e71bccc5083db12300fdc43d39d15483dd5d7eeb/calltree/?hiddenThreads=2-3-4-1-0&search=flushpendingnotifications%20layout&thread=5&threadOrder=0-2-3-5-1-4

So if we could somehow avoid flushing layout so frequently, I think we could gain a lot here. But I'm not sure whether/how we can do that... we don't control what the page JS is doing, and if it keeps dirtying stuff and then querying layout-dependent properties, we lose. :(
Flags: needinfo?(jfkthame)
Whiteboard: [QRC][QRC_NeedAnalysis] → [qf][QRC][QRC_Analyzed]
Moving this off to next round of Quantum Performance fixing for further investigation.
Whiteboard: [qf][QRC][QRC_Analyzed] → [qf:investigate][QRC][QRC_Analyzed]
platform-rel: --- → ?
Whiteboard: [qf:investigate][QRC][QRC_Analyzed] → [qf:investigate][QRC][QRC_Analyzed][platform-rel-Amazon]
Keywords: perf
platform-rel: ? → -
Andrew, please investigate this bug further. Thanks!
Assignee: jfkthame → acreskey
On the 2017 reference laptop (Core i3, 2.4 GHz) I'm not able to reproduce any performance issues loading Amazon search results.

Testing on Firefox Nightly 66 (2018-12-13).

I also tried selecting search results, watching the trailer (as the bug was initially logged), and selecting more results: no noticeable performance problems were found.

Suggest closing this one.
Assignee: acreskey → nobody
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → INCOMPLETE
You need to log in before you can comment on or make changes to this bug.