Closed Bug 694859 Opened 9 years ago Closed 7 years ago

Very sluggish tab switching to Facebook after using other tabs for a while

Categories

(Core :: General, defect)

x86_64
Windows 7
defect
Not set

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: djst, Unassigned)

Details

(Keywords: perf)

Attachments

(2 files)

OK, I'm sure this could be duped against just about any performance bug related to tab switching, but I'm filing a new one because I have some specific steps to reproduce that might be relevant/helpful.

Symptom: Switching back to a tab with a "complex" website (like Facebook) can sometimes take almost a second between clicking on the tab and Firefox actually switching to it. The lag gets worse the more you've been using other tabs between the last time the website was last used. I've tried other pages, but no page comes close to the lags I experience on Facebook.

Even with a clean profile on a very modern laptop (Sony Vaio Z, latest 2011 model, Intel i7 2.7GHz, 8GB RAM, SSD HDD), I can achieve a ~0.5s lag with just 5 tabs open.

Steps to reproduce - these gave me a 1+ second lag:

1. With a completely clean profile running either Firefox 7 or latest Nightly, log in to your Facebook account. 

2. Go to https://www.facebook.com/find-friends/browser/ and scroll down a few times to trigger the page's auto-loading of more content. The more content the page contains, the more extreme the lag is going to be in step 5 below. Keep loading more suggested friends!

3. Open up ~4 other tabs. The sites I used in my experiment were all heavy sites using Flash ads: http://cnn.com/ http://aftonbladet.se http://expressen.se http://bbc.co.uk

4. On each of these new tabs, click on one of the news headlines to force it to load one page level deeper. (This seems to affect the lag considerably -- the more you have navigated around on the pages, the longer it's going to take for Firefox to switch back to Facebook!)

5. Now, click on the Facebook tab again. If you've done enough surfing on the other tabs, you should now see a very noticeable lag between your click and the actual loading of the tab. 

6. Click on one of the other tabs again. Then click back to Facebook. This time, the lag should be much shorter.

This makes Firefox's UI feel very sluggish on my otherwise super fast computer. I normally have 50+ tabs open and switching back and forth between tabs just gets worse the more tabs I use and the heavier the sites are. Same thing with Zimbra, Twitter, etc.
Here is a screencast that shows the lag I'm experiencing on a new profile: http://www.screencast.com/t/ZvWzHVvF

I've "prepped" the four other tabs by clicking around on links at least once on each tab. You'll first see the normal lag when clicking between those four tabs, and then when I attempt to click on the Facebook tab, you will see a 1 second lag. I then click on Cnn.com again and back to Facebook, and that time the lag is considerably shorter. Lastly, I navigate one level deeper on each of the other four tabs, and then back to Facebook -- the lag is again over a second.
And here is a screencast showing the lag on the exact same tabs and the exact same browsing pattern in Chrome: http://screencast.com/t/40Z8AAPU15bU

As you can see the lag is basically nonexistent here.

Note: I included audio on both of these screencasts to indicate when I'm actually clicking on the tabs, so the lag can be experienced. Although there is some additional sluggishness seen in the screencasts caused by the tool I used to record this (Jing), the overall lag is pretty representable to what I was seeing on the screen when recording this.
Additional updates based on bug 712883 comment 13: this is likely due to graphics painting that is not optimized. 

One update to the STRs in comment 0: make sure you are running either an older PC on Windows with a battery power plan of e.g. "Energy saving mode", or "Balanced" or similar -- preferably running on battery, not cord. That way Firefox performs noticeably slower on things like switching tabs, scrolling, etc.

Chrome, in comparison, struggles far less.
(In reply to David Tenser [:djst] from comment #3)
> Additional updates based on bug 712883 comment 13: this is likely due to
> graphics painting that is not optimized. 

That comment doesn't say anything about switching back to a tab. Switching back to a tab should take one single paint of the entire page. If that is taking seconds then that is a different bug that should be investigated.

Try enabling/disabling hardware acceleration and see which configurations are fast/slow.
Product: Firefox → Core
QA Contact: general → general
(In reply to Timothy Nikkel (:tn) from comment #4)
> (In reply to David Tenser [:djst] from comment #3)
> > Additional updates based on bug 712883 comment 13: this is likely due to
> > graphics painting that is not optimized. 
> 
> That comment doesn't say anything about switching back to a tab. Switching
> back to a tab should take one single paint of the entire page. If that is
> taking seconds then that is a different bug that should be investigated.
> 
> Try enabling/disabling hardware acceleration and see which configurations
> are fast/slow.

It's the exact same thing here as in bug 712883 comment 16 - the "Balanced" power option running on battery creates massive lags, and running "High performance" eliminates the problem.

No problem in Chrome regardless of power source or power saving profile.
Does checking/unchecking the pref "Use hardware acceleration" change anything in either configuration?
(In reply to Timothy Nikkel (:tn) from comment #6)
> Does checking/unchecking the pref "Use hardware acceleration" change
> anything in either configuration?

That's a great question and I actually spent some time yesterday trying to figure out how to turn the pref off in the first place. For some reason, I can't seem to find it on this computer! I searched online for where the pref would normally be, but it doesn't look like my Sony Vaio Z has it. 

It could be that the Mobile Intel HD graphics disables this in favor of their own settings, but looking at the options under "Intel Graphics and Media Control Panel", all I can see is custom color options (brightness, gamma, etc), and one slider for 3D graphics (Performance on the one end, and Quality on the other end). I see nothing equivalent to Hardware Acceleration here. Any advice would be appreciated.
In case this is helpful, I'm attaching a lot of technical details about my DirectX configuration and hardware.
The bottom part of about:support should tell you why hardware acceleration isn't available on your system.
Sorry for not being clearer. "Use hardware acceleration" is a Firefox pref under Advanced, General. I'm curious if maybe we are using hardware acceleration when it is actually causing things to be slower or not.
Ah, sorry for not understanding. :) Yes, "Use hardware acceleration" is checked, but I can't notice a difference in this bug (or bug 712883 for that matter) when checking or unchecking it. It's always very slow when running with the battery profile "Balanced" (running on battery), and it's always very fast when running on "High performance". I can do some more testing though.

Bottom part of about:support:


  Graphics

        Adapter Description
        Mobile Intel(R) HD Graphics

        Vendor ID
        8086

        Device ID
        0126

        Adapter RAM
        Unknown

        Adapter Drivers
        igdumd64 igd10umd64 igd10umd64 igdumdx32 igd10umd32 igd10umd32

        Driver Version
        8.830.7.0

        Driver Date
        5-19-2011

        Adapter RAM (GPU #2)
        Unknown

        Adapter Drivers (GPU #2)
        Unknown

        Direct2D Enabled
        Blocked for your graphics driver version.

        DirectWrite Enabled
        false (6.1.7601.17563)

        ClearType Parameters
        ClearType parameters not found

        WebGL Renderer
        Google Inc. -- ANGLE (Mobile Intel(R) HD Graphics) -- OpenGL ES 2.0 (ANGLE 0.0.0.809)

        GPU Accelerated Windows
        1/1 Direct3D 9
Yeah this is happening to me too.  If I leave the browser on with a facebook tab on but don't have it be my active tab, when I try to switch to it, it takes a few seconds before it finishes switching.  The whole browser appears to freeze then.  However if I switch between one tab and the tab facebook is on very quickly without waiting a few minutes, then there is no lag in switching.

And this does not change anything whether I have hardware acceleration on or off.  The same result happens.

So firefox is doing something on tabs when you haven't changed to them after a few minutes.  It's like a sleep mode of some sort and it has to wake them up whenever you try to change to them.

Is there a reason for this?
Keywords: perf
Does this still happen for people on Nightly?
(In reply to Jeff Muizelaar [:jrmuizel] from comment #13)
> Does this still happen for people on Nightly?

I've not seen it.
Flags: needinfo?(djst)
I've unfortunately switched computer, so I can't verify this. Carl, do you still see this?
Flags: needinfo?(djst) → needinfo?(carl)
I will check tonight.  I just noticed that firefox 17 was released, so I will check with that one.
Flags: needinfo?(carl)
Carl, I believe you need to try with Nightly to be sure. A patch landed that may have fixed this issue, but afaic it's not in Firefox 17.
This has been fixed it seems in firefox 18.
thanks Carl
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.