Closed Bug 89900 Opened 23 years ago Closed 23 years ago

[xlib] nsAppShell::Run() is inefficient

Categories

(Core :: XUL, enhancement)

All
Linux
enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla0.9.3

People

(Reporter: roland.mainz, Assigned: roland.mainz)

References

Details

Attachments

(4 files)

Looking at Xlib-toolkit's nsAppShell::Run() - it looks inefficient for me. 1. After processing some events |nsWindow::UpdateIdle(nsnull);XFlush(mDisplay);| is called - even if new events are already in the queue. BAD. 2. XFlush(). BAD. Is that neccesary ? (See [1]) 3. It may be better to use XEventsQueued(display, QueuedAfterReading); instead of XPending()(=XEventsQueued(display, QueuedAfterFlush);) 4. Is there a fix for... -- snip -- // FIXME!!! // Block for events. For moment, use a artificial timer to // only block for a certain amount of time. // When properly fixed, this delay should be cur_time_ptr // and we need a way to detect an Xt event. -- snip -- ?
Let's keep all xlib bugs with [xlib] in front of it since they won't make a component for it to make it easier to search for things adding keywords, bug dependency
Blocks: 79119
Keywords: helpwanted
Summary: Xlib-toolkit's nsAppShell::Run() is inefficient... → [xlib] nsAppShell::Run() is inefficient
this is so out of our domain. blake says blizzard should get this (though i don't know why)
Assignee: trudelle → blizzard
Stealing this bug from blizzard...
Assignee: blizzard → Roland.Mainz
The patch looks nice... but I would perfer to move all this stuff into the hands of libXt - it has far more efficient code for handling all this stuff.
the patch does look nice. gisburn: whats wrong with using XPending() etc to check for events? No reason to keep that in Xt code. Also by looking at nsAppShell in GTK they dont even poll Xt events there, they must handle that somewhere else?
1. libXt keeps events in-order. Our current code polls each source of events with a while() loop and then steps to the next source of events. This is bad as this destroys interactivity if one source creates tons of events. BAD. (this may be one source of trouble with ns4.x plugins, too...). 2. libXt code is better than ours... :-) 3. XPending() can trigger an internal XFlush() if the source does not have anya events. BAD. ---- pocemit: I didn't look into details how ns4.x plugin stuff is working. I assume they are doing that somewhere else... or they're registering some sort of GTK+-"callback" to handle that automagically.
Filed prototype patch which uses libXt event loop instead of our own one. The code works fine except one flaw: I had to add a 2nd timeout to get the whole thing working - but I am not sure why this is required. Any ideas ?
Status: NEW → ASSIGNED
Keywords: helpwanted
Target Milestone: --- → mozilla0.9.3
Ignore my previous question... filed better patch which solves this issue. Requesting r=/sr= ... :-)
Keywords: patch, review
Whiteboard: seeking r=/sr=
Whiteboard: seeking r=/sr= → seeking sr=
You're pure Xlib toolkit is not longer just Xlib. :) sr=blizzard
blizzard: It least it's free of GDK/GTK+/Qt. That's all re need... :-) Thanks! ---- CC:'ing mkaply@us.ibm.com for checkin, please...
Whiteboard: seeking sr=
checked in: Checking in nsAppShell.cpp; /cvsroot/mozilla/widget/src/xlib/nsAppShell.cpp,v <-- nsAppShell.cpp new revision: 1.68; previous revision: 1.67 done Checking in nsAppShell.h; /cvsroot/mozilla/widget/src/xlib/nsAppShell.h,v <-- nsAppShell.h new revision: 1.22; previous revision: 1.21 done
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
May God have mercy on us all. The 212 bug spam-o-rama is Now!
QA Contact: aegis → jrgm
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: