RESOLVED FIXED 47320
[Performance] Only call sendContentResizeNotification when the scrollbar actually did change
https://bugs.webkit.org/show_bug.cgi?id=47320
Summary [Performance] Only call sendContentResizeNotification when the scrollbar actu...
Ryuan Choi
Reported 2010-10-06 19:20:07 PDT
In ScrollView::updateScrollbars, it called visibleContentsResized when scrollbars are shown or hidden. but, frameFlattening option can block creation of scrollbar. so we don't need to call visibleContentsResized.
Attachments
Patch (4.01 KB, patch)
2010-10-06 19:50 PDT, Ryuan Choi
no flags
Patch (3.57 KB, patch)
2010-12-13 16:37 PST, Ryuan Choi
no flags
Patch (4.24 KB, patch)
2011-01-09 19:08 PST, Ryuan Choi
no flags
Patch (2.48 KB, patch)
2011-04-14 06:47 PDT, Ryuan Choi
no flags
Patch (4.31 KB, patch)
2011-07-06 02:56 PDT, Ryuan Choi
no flags
Ryuan Choi
Comment 1 2010-10-06 19:50:19 PDT
Antonio Gomes
Comment 2 2010-10-07 21:10:45 PDT
Comment on attachment 70030 [details] Patch Seems reasonable to me. Did you see any perf gain?
Ryuan Choi
Comment 3 2010-10-10 01:38:18 PDT
(In reply to comment #2) > (From update of attachment 70030 [details]) > Seems reasonable to me. Did you see any perf gain? Sorry about late answer. yes, I saw sluggish scrolling at our mobile browser using frameflattening option. Those sites contains frameset or iframe. And this patch scrolling this kinds of sites make very faster than before.
Kenneth Rohde Christiansen
Comment 4 2010-10-10 05:35:35 PDT
(In reply to comment #3) > (In reply to comment #2) > > (From update of attachment 70030 [details] [details]) > > Seems reasonable to me. Did you see any perf gain? > > Sorry about late answer. > > yes, I saw sluggish scrolling at our mobile browser using frameflattening option. > Those sites contains frameset or iframe. > And this patch scrolling this kinds of sites make very faster than before. Strange, only relayout could affect scrolling, so are these sites for some reason relayouting the whole time? Maybe it is better to look into this? or optimize the frame flattening layout code. Also, frame flattening is needed for a nice touch interaction model. That is way more important than the performance.
Ryuan Choi
Comment 5 2010-10-10 19:12:10 PDT
(In reply to comment #4) > (In reply to comment #3) > > (In reply to comment #2) > > > (From update of attachment 70030 [details] [details] [details]) > > > Seems reasonable to me. Did you see any perf gain? > > > > Sorry about late answer. > > > > yes, I saw sluggish scrolling at our mobile browser using frameflattening option. > > Those sites contains frameset or iframe. > > And this patch scrolling this kinds of sites make very faster than before. > > Strange, only relayout could affect scrolling, so are these sites for some reason relayouting the whole time? Maybe it is better to look into this? or optimize the frame flattening layout code. > you're right. this patch want not to relayout if scrollbar wasn't changed. If not, ScrollView calls contentsResized and visiblieContentsResized although scrollbar wasn't created because of frameflattening. And my test site is http://postech.edu/ > Also, frame flattening is needed for a nice touch interaction model. That is way more important than the performance. Yes, so we want to use frame flattening. But I found that it's too sluggish case and I believe that this patch remove it without any side effect.
Kenneth Rohde Christiansen
Comment 6 2010-10-10 19:47:31 PDT
Ah, I understood now, so with this patch scrolling performance with frame flattening is improved. Hyatt, can you have a look at this one, please?
Antonio Gomes
Comment 7 2010-10-10 21:57:02 PDT
Generally, a user-feel improvement is valid, but there are many more accurate way to measure a performance improvement, e.g. frames per second ...
Ryuan Choi
Comment 8 2010-10-11 06:44:10 PDT
(In reply to comment #7) > Generally, a user-feel improvement is valid, but there are many more accurate way to measure a performance improvement, e.g. frames per second ... Hi, I tested using our mobile browser implemented by EFL. I don't have idea which browser(not EFL) can test this. I use ECORE_EVAS_FPS_DEBUG to get below data without any changes. without our patch. FRAME: 454, FPS: 28.0, RTIME 65% FRAME: 469, FPS: 28.7, RTIME 64% FRAME: 484, FPS: 28.3, RTIME 65% FRAME: 499, FPS: 28.9, RTIME 65% FRAME: 514, FPS: 28.4, RTIME 64% FRAME: 529, FPS: 28.4, RTIME 64% FRAME: 544, FPS: 28.4, RTIME 66% FRAME: 559, FPS: 28.1, RTIME 66% FRAME: 574, FPS: 29.3, RTIME 65% FRAME: 589, FPS: 28.5, RTIME 67% FRAME: 604, FPS: 28.4, RTIME 65% FRAME: 619, FPS: 28.6, RTIME 65% FRAME: 634, FPS: 28.8, RTIME 64% FRAME: 649, FPS: 29.0, RTIME 68% FRAME: 664, FPS: 28.7, RTIME 65% FRAME: 679, FPS: 28.6, RTIME 64% FRAME: 694, FPS: 28.6, RTIME 66% FRAME: 708, FPS: 27.8, RTIME 64% FRAME: 723, FPS: 29.0, RTIME 68% FRAME: 738, FPS: 28.4, RTIME 66% FRAME: 753, FPS: 28.7, RTIME 65% FRAME: 768, FPS: 28.6, RTIME 66% FRAME: 784, FPS: 31.3, RTIME 69% FRAME: 800, FPS: 31.4, RTIME 69% FRAME: 817, FPS: 33.4, RTIME 63% with our patch FRAME: 374, FPS: 23.8, RTIME 33% FRAME: 404, FPS: 59.4, RTIME 77% FRAME: 435, FPS: 62.0, RTIME 77% FRAME: 465, FPS: 58.8, RTIME 76% FRAME: 495, FPS: 59.4, RTIME 76% FRAME: 526, FPS: 60.3, RTIME 75% FRAME: 556, FPS: 59.9, RTIME 75% FRAME: 588, FPS: 63.1, RTIME 79% FRAME: 619, FPS: 62.0, RTIME 77% FRAME: 651, FPS: 62.9, RTIME 78% FRAME: 682, FPS: 61.5, RTIME 77% FRAME: 714, FPS: 61.9, RTIME 76% FRAME: 745, FPS: 61.8, RTIME 78% FRAME: 777, FPS: 63.2, RTIME 77% FRAME: 809, FPS: 63.1, RTIME 77% FRAME: 840, FPS: 61.0, RTIME 79% FRAME: 877, FPS: 73.8, RTIME 83%
Eric Seidel (no email)
Comment 9 2010-12-13 00:40:36 PST
Comment on attachment 70030 [details] Patch Should the caller just check avoidScrollbarCreation? Or maybe sendContentResizedNotification should just be set to the return value of the setHasHorizontalScrollbar call.
Antonio Gomes
Comment 10 2010-12-13 07:27:43 PST
Comment on attachment 70030 [details] Patch Ryan, I know your intentions and it generally makes sense. But I think doing as Eric suggested it clearer. It is strange that a setter returns something.
Ryuan Choi
Comment 11 2010-12-13 15:55:22 PST
(In reply to comment #9) > (From update of attachment 70030 [details]) > Should the caller just check avoidScrollbarCreation? Or maybe sendContentResizedNotification should just be set to the return value of the setHasHorizontalScrollbar call. Thank you for your comment. I realized my mistake. (In reply to comment #10) > (From update of attachment 70030 [details]) > Ryan, I know your intentions and it generally makes sense. But I think doing as Eric suggested it clearer. > > It is strange that a setter returns something. I'll make newer like Eric mentioned. Thanks.
Ryuan Choi
Comment 12 2010-12-13 16:37:05 PST
Kenneth Rohde Christiansen
Comment 13 2010-12-13 16:55:13 PST
Comment on attachment 76465 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=76465&action=review > WebCore/ChangeLog:15 > + You have to verify that you do not break the frame flattening tests with this change. Are you running the layout tests?
Antonio Gomes
Comment 14 2010-12-13 16:59:38 PST
Comment on attachment 76465 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=76465&action=review Also as kenneth said, Qt Gtk and Mac DRT test the flame flattening feature. Please, make sure there is no regression. > WebCore/platform/ScrollView.cpp:102 > void ScrollView::setHasVerticalScrollbar(bool hasBar) > { > - if (hasBar && avoidScrollbarCreation()) > + if (hasBar) Well, if we go for it, I would also suggest to add an assert here: ASSERT(avoidScrollbarCreation()) That way we ensure that no one is calling setHasVerticalScrollbar() without previously calling avoidScrollbarCreation()
Antonio Gomes
Comment 15 2010-12-13 17:00:13 PST
> > ASSERT(avoidScrollbarCreation()) Of course I meant ASSERT(!avoidScrollbarCreation())
Ryuan Choi
Comment 16 2010-12-13 20:08:15 PST
(In reply to comment #13) > (From update of attachment 76465 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=76465&action=review > > > WebCore/ChangeLog:15 > > + > > You have to verify that you do not break the frame flattening tests with this change. Are you running the layout tests? Sorry. With layout tests, I got failed. I think that I should investigate more. (In reply to comment #14) > (From update of attachment 76465 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=76465&action=review > > Also as kenneth said, Qt Gtk and Mac DRT test the flame flattening feature. Please, make sure there is no regression. > > > WebCore/platform/ScrollView.cpp:102 > > void ScrollView::setHasVerticalScrollbar(bool hasBar) > > { > > - if (hasBar && avoidScrollbarCreation()) > > + if (hasBar) > > Well, if we go for it, I would also suggest to add an assert here: > > ASSERT(avoidScrollbarCreation()) > > That way we ensure that no one is calling setHasVerticalScrollbar() without previously calling avoidScrollbarCreation() Sorry, This patch was wrong. I'll prepare new patch after those testing.
Ryuan Choi
Comment 17 2011-01-09 19:08:54 PST
Brent Fulgham
Comment 18 2011-04-11 13:41:20 PDT
Comment on attachment 78365 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=78365&action=review > Source/WebCore/platform/ScrollView.cpp:89 > + ASSERT(!(hasBar && avoidScrollbarCreation())); I don't understand why the "hasBar && avoidScrollbarCreation()" test no longer returns. You assert if this case is true -- do you want to execute the code under this condition? > Source/WebCore/platform/ScrollView.cpp:105 > + ASSERT(!(hasBar && avoidScrollbarCreation())); Ditto
Ryuan Choi
Comment 19 2011-04-14 06:47:04 PDT
Ryuan Choi
Comment 20 2011-04-14 06:54:10 PDT
(In reply to comment #18) > (From update of attachment 78365 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=78365&action=review > > > Source/WebCore/platform/ScrollView.cpp:89 > > + ASSERT(!(hasBar && avoidScrollbarCreation())); > > I don't understand why the "hasBar && avoidScrollbarCreation()" test no longer returns. You assert if this case is true -- do you want to execute the code under this condition? > > > Source/WebCore/platform/ScrollView.cpp:105 > > + ASSERT(!(hasBar && avoidScrollbarCreation())); > > Ditto Sorry about late answer. This patch is old and I can't assure any side effects. So I simplified my patch to explain what I really want. It will be fine, but check hasBar && avoidScrollbarCreation two times.
Eric Seidel (no email)
Comment 21 2011-05-23 15:17:06 PDT
James should see this go by.
Eric Seidel (no email)
Comment 22 2011-07-05 20:42:13 PDT
Comment on attachment 89577 [details] Patch Seems reasonable to me. But I know very little about the scrollbar code.
Eric Seidel (no email)
Comment 23 2011-07-05 20:42:44 PDT
James, Hyatt, Peter? Someone who's worked in scrollbars?
Peter Kasting
Comment 24 2011-07-05 23:15:32 PDT
Comment on attachment 89577 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=89577&action=review In theory this seems OK, but I'm not a WebKit reviewer. > Source/WebCore/platform/ScrollView.cpp:500 > if (hasHorizontalScrollbar != newHasHorizontalScrollbar) { Nit: I think it might be clearer to write this block as follows: if (hasHorizontalScrollbar != newHasHorizontalScrollbar && (hasHorizontalScrollbar || !avoidScrollbarCreation())) { ... original block contents here... } ...and the same for the case below. This makes it a bit clearer that we don't want to do anything in the case where we're supposed to avoid scrollbar creation. I would also like to see setHasXXXScrollbar() converted from conditional-checking (hasBar && avoidScrollbarCreation()) into asserting that that combination is false. Either this is safe because these are the only places which call these functions, or else your patch should probably be expanded to the other callers thereof. In either case, making this expectation part of those functions' contracts seems clearer and safer long-term to me.
Ryuan Choi
Comment 25 2011-07-06 02:56:05 PDT
Ryuan Choi
Comment 26 2011-07-06 02:57:30 PDT
(In reply to comment #24) > (From update of attachment 89577 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=89577&action=review > > In theory this seems OK, but I'm not a WebKit reviewer. > > > Source/WebCore/platform/ScrollView.cpp:500 > > if (hasHorizontalScrollbar != newHasHorizontalScrollbar) { > > Nit: I think it might be clearer to write this block as follows: > > if (hasHorizontalScrollbar != newHasHorizontalScrollbar && (hasHorizontalScrollbar || !avoidScrollbarCreation())) { > ... original block contents here... > } > > ...and the same for the case below. This makes it a bit clearer that we don't want to do anything in the case where we're supposed to avoid scrollbar creation. > > I would also like to see setHasXXXScrollbar() converted from conditional-checking (hasBar && avoidScrollbarCreation()) into asserting that that combination is false. Either this is safe because these are the only places which call these functions, or else your patch should probably be expanded to the other callers thereof. In either case, making this expectation part of those functions' contracts seems clearer and safer long-term to me. Thank you for your comment. I updated like you mentioned.
Peter Kasting
Comment 27 2011-07-06 10:58:03 PDT
Comment on attachment 99804 [details] Patch Informal r+ from me; you'll need a real reviewer to do the formal r+.
Eric Seidel (no email)
Comment 28 2011-07-06 11:05:01 PDT
Comment on attachment 99804 [details] Patch Thanks Peter and Ryuan.
WebKit Review Bot
Comment 29 2011-07-06 12:05:01 PDT
Comment on attachment 99804 [details] Patch Clearing flags on attachment: 99804 Committed r90478: <http://trac.webkit.org/changeset/90478>
WebKit Review Bot
Comment 30 2011-07-06 12:05:11 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.