Closed
Bug 681867
Opened 13 years ago
Closed 13 years ago
Scrolling a GMail email conversation is really slow and chunky
Categories
(Core :: Layout, defect)
Tracking
()
VERIFIED
FIXED
mozilla10
People
(Reporter: bent.mozilla, Assigned: roc)
References
Details
(Keywords: verified-beta, Whiteboard: [qa!])
Attachments
(3 files, 1 obsolete file)
4.26 KB,
patch
|
MatsPalmgren_bugz
:
review+
|
Details | Diff | Splinter Review |
2.24 KB,
patch
|
MatsPalmgren_bugz
:
review+
|
Details | Diff | Splinter Review |
6.94 KB,
patch
|
MatsPalmgren_bugz
:
review+
christian
:
approval-mozilla-aurora+
|
Details | Diff | Splinter Review |
I don't know if GMail has done something new (the floating top bar seems new) or if I'm just noticing this because I switched to Windows for my primary machine a few days ago, but scrolling a GMail email conversation is really bad. It's slow, jerks, lags way behind my mouse, and it seems to chew CPU. This new machine of mine has a pretty good graphics card and everything claims to be fully accelerated... Disabling the acceleration doesn't seem to make any difference.
Opening Chrome and scrolling is smooth and fast. What are we doing differently?
Reporter | ||
Comment 1•13 years ago
|
||
Interesting... When the conversation has only a few emails in it scrolling isn't really bad.
When you have a lot of emails in one conversation GMail will group them all together and just show little lines for each message. Scrolling in this stage is worse than with only a few messages but not terrible.
Then when you click on the collection of lines they expand to show subject lines. Here scrolling is really awful.
As you click each subject line to expand the message scrolling seems to get better.
It's got to be something funny with the way they do those collapsed message subject line headers?
Well, can we dupe this against bug 579260 or is there something specific in this bug report?
Assignee | ||
Comment 3•13 years ago
|
||
Comment #1 is useful. I want to work on this.
Assignee: nobody → roc
Assignee | ||
Comment 4•13 years ago
|
||
Hmm, has this gotten better by itself?
Assignee | ||
Comment 5•13 years ago
|
||
I didn't get numbers before, but it feels a little better to me than it used to. But here are some real numbers:
I used this bookmarklet in Firefox and Chrome:
var startTime=Date.now(); var iters = 0; function doScroll() { var w = document.getElementById("canvas_frame").contentWindow; w.scrollTo(0, w.scrollY==200 ? 210 : 200); if (iters++ < 100) setTimeout(doScroll, 0); else alert(w.innerWidth + "x" + w.innerHeight + ": " + (Date.now() - startTime) + "ms"); } doScroll();
Content window for both browsers 1543x816
Scrolling dev.planning folder view:
Firefox trunk: 3050ms
Chrome: 1650ms
Scrolling "a five week release cycle?" thread view (nothing expanded):
Firefox trunk: 9750ms
Chrome: 2600ms
Scrolling "a five week release cycle?" thread view (subjects expanded):
Firefox trunk: 9200ms
Chrome: 6260ms
There's an additional problem where transitioning from "scrolling headers" to "fixed headers" as you scroll down is janky in Firefox. I'll look at that later.
Assignee | ||
Comment 6•13 years ago
|
||
I profiled "scrolling dev.planning folder view".
21% of the time under InvalidateFixedBackgroundFrames, called during every scrollTo. This builds a display list, computes visibility, then walks the list to see if there's anything visible that needs to be repainted whenever we scroll. I'm not sure what's triggering this in GMail ... it could be either text-overflow or background-attachment:fixed. We should be able to eliminate this somehow.
33% of the time is under FrameLayerBuilder::DrawThebesLayer, painting ThebesLayer contents. This seems excessive given we're only scrolling by 10 pixels. Maybe there's invalidation being caused by InvalidateFixedBackgroundFrames.
About 24% of the time is display list construction and layer building during painting.
Altogether 62% of the time is painting. About 5% compositing layers and other misc overhead.
The rest of the profile is frittered away on script execution, some event handlers, some random unassigned driver work, and various other overhead.
Assignee | ||
Comment 7•13 years ago
|
||
SetHasFixedBackgroundFrame was being called for text-overflow elements (the label names in GMail's left-hand pane), which was forcing us to do those expensive InvalidateFixedBackgroundFrames and then forcing us to do unnecessary painting.
All we need to do for text-overflow is ensure that when the text-overflow's scrolling block is scrolled, the contents of the block are repainted, so let's do that explicitly using a state bit on the scrollframe.
This improves "scrolling dev.planning folder view" to 1550ms. I'm declaring victory on that one.
Attachment #568300 -
Flags: review?(matspal)
Assignee | ||
Comment 8•13 years ago
|
||
This improves "a five week release cycle? thread view (nothing expanded)" to 2580ms.
It improves "a five week release cycle? thread view (subjects expanded)" to about 1800ms.
I'll look into the "nothing expanded" case, we're already about as fast as Chrome there with the patch, but I'd like to know why it's slower than with subjects expanded ... it should be displaying less actual content.
Assignee | ||
Comment 10•13 years ago
|
||
In the "nothing expanded" case, we're spending a significant amount of time painting linear gradients, but I can't yet see what the gradient is being used for.
Comment 11•13 years ago
|
||
OK, thanks for explaining.
Assignee: roc → nobody
Status: NEW → ASSIGNED
Component: Graphics → Layout
QA Contact: thebes → layout
Assignee | ||
Comment 12•13 years ago
|
||
(In reply to Robert O'Callahan (:roc) (Mozilla Corporation) from comment #8)
> This improves "a five week release cycle? thread view (nothing expanded)" to
> 2580ms.
Retesting this morning, I'm getting more like 1800ms (quite variable, but always under 2000ms). So I'm declaring victory on this entire bug.
Comment 13•13 years ago
|
||
Comment on attachment 568300 [details] [diff] [review]
Part 1: fix text-overflow issues
Please update the DidProcessLines() doc comment in TextOverflow.h
Attachment #568300 -
Flags: review?(matspal) → review+
Updated•13 years ago
|
Attachment #568304 -
Flags: review?(matspal) → review+
Updated•13 years ago
|
Assignee: nobody → roc
Assignee | ||
Comment 14•13 years ago
|
||
I filed bug 696248 on the last issue in comment #5.
Assignee | ||
Comment 15•13 years ago
|
||
I realized we actually don't need DidProcessLines at all now.
Attachment #568553 -
Flags: review?(matspal)
Assignee | ||
Comment 16•13 years ago
|
||
Oops, that one didn't build.
Attachment #568553 -
Attachment is obsolete: true
Attachment #568553 -
Flags: review?(matspal)
Attachment #568556 -
Flags: review?(matspal)
Comment 17•13 years ago
|
||
Comment on attachment 568556 [details] [diff] [review]
improved v2
Please update the class doc comment in TextOverflow.h
Attachment #568556 -
Flags: review?(matspal) → review+
Assignee | ||
Comment 18•13 years ago
|
||
Assignee | ||
Updated•13 years ago
|
Whiteboard: [inbound]
Comment 19•13 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/c27c06a3a50a
https://hg.mozilla.org/mozilla-central/rev/af7752f0ae31
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Whiteboard: [inbound]
Target Milestone: --- → mozilla10
Comment 20•13 years ago
|
||
roc, it appears you landed the original v2 patch instead of the improved one?
Comment 21•13 years ago
|
||
Looks correct to me.
Comment 22•13 years ago
|
||
Whoops, was equating v2 with part 2. Sorry for the spam.
Assignee | ||
Comment 23•13 years ago
|
||
Comment on attachment 568556 [details] [diff] [review]
improved v2
Review of attachment 568556 [details] [diff] [review]:
-----------------------------------------------------------------
Requesting Aurora approval. This fixes a performance regression due to text-overflow landing. It affects at least one very important site. The fix is very low risk ... any regression is likely to involve scrolling in an element with text-overflow, which is completely broken in most other browsers already.
Attachment #568556 -
Flags: approval-mozilla-aurora?
Assignee | ||
Updated•13 years ago
|
status-firefox9:
--- → affected
Comment 25•13 years ago
|
||
This has been missed in triage a couple of times, and a dupe has been filed. It's a highly visible site to users, feels like big win and Roc's assertion of low risk in comment 23 gives me warm fuzzy feelings - any reason why triage has passed it by a few times?
Comment 26•13 years ago
|
||
Comment on attachment 568556 [details] [diff] [review]
improved v2
[triage comment]
Thanks for flagging. We slogged through all the beta stuff as it was higher priority but all those lists are back to zero so now we're on aurora :-)
Approved for aurora9, this looks like a great fix. Thanks!
Attachment #568556 -
Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
Assignee | ||
Comment 27•13 years ago
|
||
Assignee | ||
Comment 28•13 years ago
|
||
This regression affects Firefox 8 as well. Don't suppose we can still get this in there?
status-firefox8:
--- → affected
tracking-firefox8:
--- → ?
Comment 29•13 years ago
|
||
Adding [qa+] to make sure it gets verified where it lands. Looks like a high impact bug that can be verified easily.
Whiteboard: [qa+]
Comment 30•13 years ago
|
||
Seems to work well in Firefox 9.0b3. Marking verified.
You need to log in
before you can comment on or make changes to this bug.
Description
•