Closed Bug 49300 Opened 26 years ago Closed 26 years ago

gratuitous gdk_window_get_events() in nsWindow::CreateNative()

Categories

(Core :: XUL, defect, P3)

x86
Linux
defect

Tracking

()

VERIFIED FIXED

People

(Reporter: alla, Assigned: rods)

References

Details

(Keywords: perf, Whiteboard: [nsbeta3+]Fix in hand)

Attachments

(4 files)

I'm looking at profiling hotspots from bug 39573. One of them is nsWindow::CreateNative() calling gdk_window_get_events(). This means waiting for a Xserver response stalling the Xserver communications. Reading the events is done so that some extra events can be added. This is better done by gtk_widget_add_events() which doesn't do the server roundtrip. I'll append a patch. This helps bug 39573 a lot, especially when displaying remote.
Attached a patch and added patch and perf keywords.
Keywords: patch, perf
Blocks: 39573
Just a note. The reason this is a performance improvement is that gtk_widget_add_event() doesn't call gdk_window_get_events() for non-realized windows.
->pavlov
Assignee: trudelle → pavlov
Target Milestone: --- → M18
Status: UNCONFIRMED → NEW
Ever confirmed: true
this patch unfortunatly doesn't really do anything... gtk_widget_add_events simply calls gdk_window_set_events(window, gdk_window_get_events(window) | events)
Sorry sorry. I'm a moron. I'll attach a new patch that really fixes this. (This time i double checked the code and the jprof output.)
Pavlov, what's up with the status on this one? I've got it in my tree for a long time now, and it works well.
Two comments about this patch Is AddToEventMask() used anywhere else? If it isn't remove it. If it is it might be a hotspot for those widgets. Also, at the end of this patch you do: if (mMozArea) { ... gdk_window_set_events(mShell->window, mask); shouldn't that be: gdk_window_set_events(mMozArea->window, mask);
It seems to be used a lot from other widgets. But since they are not used much anymore i dont think it is a problem. The gdk_window_set_events(mMozArea->window, mask) is probably more correct yes. I'm cooking up a new patch.
Attached patch new fix — — Splinter Review
Ok. New fix attached. If i can get some r= loving i could try checking this in myself.
sorry for taking so long. r=pavlov. please go ahead and check this in. (or I can if you'd prefer)
I'll take the bug, because I will be checking in the fix with 39573. Nominating for nsbeta3 because this and the fix to 39573 speed mozilla up quite a bit.
Assignee: pavlov → rods
Keywords: nsbeta3
Status: NEW → ASSIGNED
Summary: gratious gdk_window_get_events() in nsWindow::CreateNative() → gratuitous gdk_window_get_events() in nsWindow::CreateNative()
Whiteboard: Fxi in hand
Marking nsbeta3+
Whiteboard: Fxi in hand → [nsbeta3+]Fxi in hand
fixed
Status: ASSIGNED → RESOLVED
Closed: 26 years ago
Resolution: --- → FIXED
Whiteboard: [nsbeta3+]Fxi in hand → [nsbeta3+]Fix in hand
It's checked in now, thanks.
versions 1.301 and 1.303 in the tree contain all patches mentioned here. Marking VERIFIED.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: