Bug 120012 - 100% cpu usage for "transition: opacity" animation
Summary: 100% cpu usage for "transition: opacity" animation
Status: CLOSED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Luciano Wolf
URL: http://www.webkit.org/blog-files/leaves/
Keywords:
Depends on:
Blocks:
 
Reported: 2013-08-19 10:01 PDT by Luciano Wolf
Modified: 2013-08-29 04:10 PDT (History)
11 users (show)

See Also:


Attachments
Proposed fix - WIP - doesn't include ChangeLog yet. (656 bytes, patch)
2013-08-19 10:01 PDT, Luciano Wolf
no flags Details | Formatted Diff | Diff
Patch (1.68 KB, patch)
2013-08-27 13:44 PDT, Luciano Wolf
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Luciano Wolf 2013-08-19 10:01:48 PDT
Created attachment 209095 [details]
Proposed fix - WIP - doesn't include ChangeLog yet.

While running leaves demo, the CPU tops at 100% for WebProcess. Even simple examples like LayoutTests/compositing/repaint/opacity-between-absolute.html does the same.

Doing some research I've found that CoordinatedLayerTreeHost::scheduleAnimation() does set a timer for animation and right after that it schedules again the same timer with 0. This behavior could be avoided if we call scheduleLayerFlush() before m_layerFlushTimer.startOneShot(m_coordinator->nextAnimationServiceTime()).

I've detected this issue on NIX port, but I wasn't able to compile Qt, GTK or EFL.
Comment 1 JeongBong Seo 2013-08-20 15:39:55 PDT
It also detected and resolved by your idea with Qt port.
Comment 2 Luciano Wolf 2013-08-27 12:23:08 PDT
So, is this patch useful? Should I updated it with ChangeLog info and ask for review?
Comment 3 Noam Rosenthal 2013-08-27 12:59:55 PDT
(In reply to comment #2)
> So, is this patch useful? Should I updated it with ChangeLog info and ask for review?

Yes please!
Comment 4 Luciano Wolf 2013-08-27 13:44:59 PDT
Created attachment 209793 [details]
Patch
Comment 5 JeongBong Seo 2013-08-27 15:13:59 PDT
I added a reivew as a comment. (Because, I don't have the auth.)

Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:399
>      scheduleLayerFlush();

I think, scheduleLayerFlush() at this moment is meaningless.
How about erase that and insert below?

if(!m_layerFlushSchedulingEnabled)
    return;
Comment 6 WebKit Commit Bot 2013-08-27 15:22:11 PDT
Comment on attachment 209793 [details]
Patch

Clearing flags on attachment: 209793

Committed r154711: <http://trac.webkit.org/changeset/154711>
Comment 7 WebKit Commit Bot 2013-08-27 15:22:13 PDT
All reviewed patches have been landed.  Closing bug.
Comment 8 Luciano Wolf 2013-08-29 04:10:42 PDT
(In reply to comment #5)
> I added a reivew as a comment. (Because, I don't have the auth.)
> 
> Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:399
> >      scheduleLayerFlush();
> 
> I think, scheduleLayerFlush() at this moment is meaningless.
> How about erase that and insert below?
> 
> if(!m_layerFlushSchedulingEnabled)
>     return;

Sorry, I missed your comment among commit messages :)

I'll test and provide an updated patch. Thanks for your suggestion.