Bug 24913 - [Qt] NPAPI: Excessive timer usage and high CPU load
Summary: [Qt] NPAPI: Excessive timer usage and high CPU load
Status: RESOLVED INVALID
Alias: None
Product: WebKit
Classification: Unclassified
Component: Plug-ins (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords: Performance, Qt, QtTriaged
: 35777 (view as bug list)
Depends on:
Blocks: 35962
  Show dependency treegraph
 
Reported: 2009-03-28 11:52 PDT by Firuz Kosimov
Modified: 2014-02-03 03:12 PST (History)
6 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Firuz Kosimov 2009-03-28 11:52:31 PDT
I use qtwebkit 4.5 on my application and qtwebkit 4.5 supports flash plugin. When I enable flash plugin and navigate to a web-page with flash (youtube.com or any other with flash banner) the cpu load jumps up to 40-70% and the process-detail column "page fault delta" goes 30,000-60,000 every second. The demo-browser that is shipped with qt 4.5 has the same problem.

The steps to reproduce: 
1)install qt 4.5
2)launch demo-browser from examples (notice cpu-load doesnt stay steadily when you navigate to pages without flash)
3)navigate to youtube.com
4)The cpu usage jumps to 40-70% and it doesnt go down. "page fault delta" in the process-detail column of task manager goes to 30,000-60,000 and stays at such pace.

I guess the cpu load and "page fault delta" should not stay up that high during viewing web-pages with flash elements.
Comment 1 David T. L. Wong 2010-01-20 02:28:58 PST
I experience this problem too. 
Using Qt 4.6 and MSVC2008 on Windows XP.
Webkit source is svn trunk r53272.

It seems there are too many timer event.

I modified SharedTimerQt::start() in WebCore/platform/qt/SharedTimerQt.cpp to:

void SharedTimerQt::start(double fireTime)
{
    static int zero_interval_count = 0;
    double interval = fireTime - currentTime();
    unsigned int intervalInMS;
	if (interval < 0) {
        intervalInMS = 0;
	} else {
        interval *= 1000;
        intervalInMS = (unsigned int)interval;
    }

	if (intervalInMS == 0) {
		zero_interval_count++;
		if ((zero_interval_count % 10000) == 0) {
			printf("zero_interval_count = %d, time = %f\n", zero_interval_count, currentTime());
		}
	}
    m_timer.start(intervalInMS, this);
}

on simple flash that only display a digital clock,
It records 10,000 m_timer.start() calls, with interval equals zero, in 0.536 second

on http://www.adobe.com/flashplatform/ ,
It records 10,000 m_timer.start() calls, with interval equals zero, in 3.165 second
Comment 2 Ismail Donmez 2010-03-26 03:30:30 PDT
I also see this but without any plugin, one such a page is http://en.m.wikipedia.org/wiki?search=dinasour
Comment 3 Benjamin Poulain 2010-04-30 03:12:42 PDT
*** Bug 35777 has been marked as a duplicate of this bug. ***
Comment 4 Jocelyn Turcotte 2014-02-03 03:12:54 PST
=== Bulk closing of Qt bugs ===

If you believe that this bug report is still relevant for a non-Qt port of webkit.org, please re-open it and remove [Qt] from the summary.

If you believe that this is still an important QtWebKit bug, please fill a new report at https://bugreports.qt-project.org and add a link to this issue. See http://qt-project.org/wiki/ReportingBugsInQt for additional guidelines.