gnash-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gnash-dev] Re: performance: 1000 wakeups/sec when idle!


From: Yuriy Kaminskiy
Subject: [Gnash-dev] Re: performance: 1000 wakeups/sec when idle!
Date: Fri, 05 Jun 2009 15:32:54 +0400
User-agent: Icedove 1.5.0.14eol (X11/20090105)

strk wrote:
> On Tue, Jun 02, 2009 at 12:28:06PM -0700, John Gilmore wrote:
>> When I pause the video, it goes up to about 400 wakeups/sec (140 from
>> schedule_hrtimeout_range from gnash, and 120 from do_nanosleep from
>> gnash).  
> I don't think gnash is calling those two functions directly, must
> be some dependent library.
Of cause, that's kernel functions, they cannot be called directly by
userspace at all.
It caused by userspace using too short delays in nanosleep/usleep/
select/poll/setitimer/...
Fragment of strace paused gtk-gnash/agg 0.8.5 with "set delay 50":
ioctl(3, FIONREAD, [0])                 = 0
gettimeofday({1244200744, 140595}, NULL) = 0
poll([{fd=3, events=POLLIN}], 1, 49)    = 0
gettimeofday({1244200744, 196519}, NULL) = 0
ioctl(3, FIONREAD, [0])                 = 0
Fragment of strace paused gtk-gnash/agg 0.8.5 with commented "set delay":
gettimeofday({1244200978, 360721}, NULL) = 0
poll([{fd=3, events=POLLIN}], 1, 9)     = 0
gettimeofday({1244200978, 376522}, NULL) = 0
ioctl(3, FIONREAD, [0])                 = 0
This is not right at all. Unless you have running timer (and no timer
run in paused mode), you should not set timeout in poll() at all
(something like poll(nfd, fds, -1)); or, at least, set it way higher.
See also http://www.lesswatts.org/projects/applications-power-management/





reply via email to

[Prev in Thread] Current Thread [Next in Thread]