Created attachment 122303 [details] demo which demonstrates slowness of XGetWindowAttributes on El Capitan Lots of X Window programs use XGetWindowAttributes to check window visibility before drawing. I use it in my code, but toolkits like Motif also use it internally. XGetWindowAttributes is VERY SLOW on El Capitan, approximately 700 times slower than on older versions of Mac OS X, or on Linux of comparable processing power. As a result, programs work, but they are slow to the point of being useless - by clicking on menus, you can observe the menu being open and drawn, line by line. Or if a complex window is resized, it refreshes itself for minutes, before GUI becomes responsive again. I have prepared a small Xlib only test program, one page, no toolkit, which calls XGetWindowAttributes in a loop while drawing colored rectangles. Strictly speaking, XGetWindowAttributes is not necessary in the demo; it is there only to demonstrate how visibly slow it is, compared to older OS X versions or other X Window implementations. Linux 4K, Suse 42.1; i7: 0.5 seconds iMac 27, OS X 10.0.6; i5: 1.5 seconds iMac 27 retina, OS X 10.11, i5: 10 minutes 58 seconds
There’s not much we can do about OS regressions.
BTW, for future reference, you can file bug reports against the OS at http://bugreport.apple.com The performance regressions with 10.10 and later are already tracked at <rdar://problem/19116159>.
Should the bug be at least investigated or reported upstream? How does one do that with Apple? It is a pity that so much work, which went in making XQuartz, and ours to port the software to Apple, would go to waste if such regressions are not resolved. I have looked at the XGetWindowAttributes source and can't see what could cause such slow response time. http://www.opensource.apple.com/source/X11libs/X11libs-40.2/libX11/libX11-1.2.1/src/GetWAttrs.c code is mostly filling in the structures. The only possibly timing critical functions involve AsyncHandler but I don't know enough about X internals to be sure. if (!_XReply (dpy, (xReply *)&rep, 0, xTrue)) { DeqAsyncHandler(dpy, &async); return (0); } DeqAsyncHandler(dpy, &async); Is there a way to profile Xlib to verify where exactly is the time lost?
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.