Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Throttling inactive windows/browsers

7 views
Skip to first unread message

James Willcox

unread,
Dec 4, 2009, 2:00:32 PM12/4/09
to dev-pl...@lists.mozilla.org
Hi,

I'm looking into ways of somehow throttling the CPU usage in inactive
XUL windows (and browsers in them) in our xulrunner-using application.
There is a rumor that Firefox can somehow do this with inactive tabs.
Is that true? I haven't been able to find anything about it so far.

I know this will probably become a lot easier once the out-of-process
stuff lands, but if anyone has suggestions on how to accomplish this
with xulrunner 1.9.1 I'd appreciate it.

Thanks,
James

L. David Baron

unread,
Dec 4, 2009, 2:35:38 PM12/4/09
to dev-pl...@lists.mozilla.org
On Friday 2009-12-04 14:00 -0500, James Willcox wrote:
> I'm looking into ways of somehow throttling the CPU usage in inactive
> XUL windows (and browsers in them) in our xulrunner-using application.
> There is a rumor that Firefox can somehow do this with inactive tabs.
> Is that true? I haven't been able to find anything about it so far.

What Firefox does it based on a hack that tests widget visibility.
We really need to replace that hack with an API, as described in
https://bugzilla.mozilla.org/show_bug.cgi?id=465216
https://bugzilla.mozilla.org/show_bug.cgi?id=343515

If you did something that hid widgets (e.g., put your browser inside
a deck, and switched to a different element in the deck), you could
ride along on this.

That said, I think it doesn't really throttle very much; the big
performance win is that it suppresses resizing of all the hidden
tabs until you switch to them.

(At some point in the near future I'd like to hook both the
hiddenness notifications and more things that are on timers up to
nsRefreshDriver, and thus suppress a good bit more.)

-David

--
L. David Baron http://dbaron.org/
Mozilla Corporation http://www.mozilla.com/

James Willcox

unread,
Dec 4, 2009, 2:53:48 PM12/4/09
to L. David Baron, dev-pl...@lists.mozilla.org
David,

Thanks for the tip! We never resize the browser or window at all, so
maybe it won't mean much for us. I'll give it a shot.

Thanks,
James

FAITHMolina

unread,
Aug 19, 2011, 6:02:32 AM8/19/11
to
freelance writer


0 new messages