Discussion:
XCB?
Johannes Wegener
2008-09-14 10:02:34 UTC
Permalink
I recently read that awesome is going to use XCB over Xlib and says that
it is faster becouse it is asynchronous.
Does XCB realy its job faster than Xlib?
And if this is the case is dwm going to use XCB in any further release?

Just some stupid questions - don't take them to serious - I like dwm and
how it is,its just some kind of intrest in that thing of XCB :)

Johannes Wegener
Anselm R Garbe
2008-09-14 11:32:25 UTC
Permalink
Post by Johannes Wegener
I recently read that awesome is going to use XCB over Xlib and says that
it is faster becouse it is asynchronous.
Does XCB realy its job faster than Xlib?
And if this is the case is dwm going to use XCB in any further release?
I'd be interested in benchmarks proving this thesis. Xlib isn't
synchronous either, though it can be enforced by clients to process
all pending requests using XSync(). I'd bet that a thread-safe Xlib
reimplementation from scratch using C might be a lot faster than XCB,
since XCB is generated code in plenty parts.
Post by Johannes Wegener
Just some stupid questions - don't take them to serious - I like dwm and
how it is,its just some kind of intrest in that thing of XCB :)
I have in mind to give dwm on xcb a try.

Kind regards,
--Anselm
Tobias Ulmer
2008-09-14 17:23:34 UTC
Permalink
Post by Anselm R Garbe
Post by Johannes Wegener
I recently read that awesome is going to use XCB over Xlib and says that
it is faster becouse it is asynchronous.
Does XCB realy its job faster than Xlib?
And if this is the case is dwm going to use XCB in any further release?
I'd be interested in benchmarks proving this thesis. Xlib isn't
synchronous either, though it can be enforced by clients to process
all pending requests using XSync(). I'd bet that a thread-safe Xlib
reimplementation from scratch using C might be a lot faster than XCB,
since XCB is generated code in plenty parts.
Post by Johannes Wegener
Just some stupid questions - don't take them to serious - I like dwm and
how it is,its just some kind of intrest in that thing of XCB :)
I have in mind to give dwm on xcb a try.
Keep in mind that this locks out a number of users not running bleeding
edge stuff...
Post by Anselm R Garbe
Kind regards,
--Anselm
Don Stewart
2008-09-14 19:00:34 UTC
Permalink
Post by Tobias Ulmer
Post by Anselm R Garbe
Post by Johannes Wegener
I recently read that awesome is going to use XCB over Xlib and says that
it is faster becouse it is asynchronous.
Does XCB realy its job faster than Xlib?
And if this is the case is dwm going to use XCB in any further release?
I'd be interested in benchmarks proving this thesis. Xlib isn't
synchronous either, though it can be enforced by clients to process
all pending requests using XSync(). I'd bet that a thread-safe Xlib
reimplementation from scratch using C might be a lot faster than XCB,
since XCB is generated code in plenty parts.
Post by Johannes Wegener
Just some stupid questions - don't take them to serious - I like dwm and
how it is,its just some kind of intrest in that thing of XCB :)
I have in mind to give dwm on xcb a try.
Keep in mind that this locks out a number of users not running bleeding
edge stuff...
I think this is the biggest concern. Just look at the dependencies:

http://aur.archlinux.org/packages.php?ID=18981

cairo-xcb
dbus
gtk2
imlib2
libev
libgpg-error
libxcb
lua
luafilesystem

So that's starting to get a bit serious.

On Debian it is just ridiculous,

http://packages.debian.org/experimental/awesome

dep libc0.1
dep: libc6
dep: libc6.1
dep: libcairo2
dep: libdbus-1-3
dep: libev3
dep: libglib2.0-0
dep: libgtk2.0-0
dep: libimlib2
dep: liblua5.1-0
dep: libncurses5
dep: libpango1.0-0
dep: libreadline5
dep: libx11-6
dep: libxcb-atom0
dep: libxcb-aux0
dep: libxcb-event0
dep: libxcb-icccm0
dep: libxcb-keysyms0
dep: libxcb-property0
dep: libxcb-randr0
dep: libxcb-render-util0
dep: libxcb-render0
dep: libxcb-xinerama0
dep: libxcb1

Of course, this might pay off for them in the long run, once all this
stuff is supported.

The performance question is just advertising, without numbers.

Despite all this, they seem to be picking up users. Users like features, I guess.

-- Don
Kai Großjohann
2008-09-14 20:49:53 UTC
Permalink
Post by Don Stewart
Post by Tobias Ulmer
Keep in mind that this locks out a number of users not running bleeding
edge stuff...
http://aur.archlinux.org/packages.php?ID=18981
cairo-xcb
dbus
gtk2
imlib2
libev
libgpg-error
libxcb
lua
luafilesystem
Which ones are related to XCB per se? For instance, I know that awesome
now offers Lua scripting, but I'd be surprised if Lua was a requirement
for XCB.

Kai
Bill Puschmann
2008-10-03 14:04:10 UTC
Permalink
Nothing in the dep list looks horrible to me personally (as my used apps
have pulled most of those in already).

But I'd really hate to see dwm start to suffer from the same type of "must
install plan9" dependencies that wmii had. It really doesn't matter how
small/compact your window manager is if you have to install a 20MB+ set of
utilities to use it. And I'm worried that XCB would end up adding the same
to dwm without providing much more benefit.


--
"You took the words right out of my mouth, Penfold"
"Sorry, sir, do you want them back?"
Post by Tobias Ulmer
Keep in mind that this locks out a number of users not running bleeding
edge stuff...
http://aur.archlinux.org/packages.php?ID=18981
cairo-xcb
dbus
gtk2
imlib2
libev
libgpg-error
libxcb
lua
luafilesystem
Which ones are related to XCB per se? For instance, I know that awesome
now offers Lua scripting, but I'd be surprised if Lua was a requirement for
XCB.
Kai
Anselm R Garbe
2008-09-14 20:02:02 UTC
Permalink
Post by Tobias Ulmer
Post by Anselm R Garbe
Post by Johannes Wegener
I recently read that awesome is going to use XCB over Xlib and says that
it is faster becouse it is asynchronous.
Does XCB realy its job faster than Xlib?
And if this is the case is dwm going to use XCB in any further release?
I'd be interested in benchmarks proving this thesis. Xlib isn't
synchronous either, though it can be enforced by clients to process
all pending requests using XSync(). I'd bet that a thread-safe Xlib
reimplementation from scratch using C might be a lot faster than XCB,
since XCB is generated code in plenty parts.
Post by Johannes Wegener
Just some stupid questions - don't take them to serious - I like dwm and
how it is,its just some kind of intrest in that thing of XCB :)
I have in mind to give dwm on xcb a try.
Keep in mind that this locks out a number of users not running bleeding
edge stuff...
Don't worry, there is no plan to join XCB by default yet, I only want
to check, and maybe rant ;)

Kind regards,
--Anselm
Donald Chai
2008-09-14 15:28:24 UTC
Permalink
Post by Johannes Wegener
I recently read that awesome is going to use XCB over Xlib and says that
it is faster becouse it is asynchronous.
Does XCB realy its job faster than Xlib?
And if this is the case is dwm going to use XCB in any further
release?
IMHO, asynchonicity probably only matters if you're using a bloated
app over a slow (network) connection. Since you're probably running
your window manager on your local machine, I'm not sure this will
help dwm.

What would make dwm fast is really to minimize the number of Map and
Expose events, so e.g. you don't render a Firefox window if it's
unnecessary (cf. changeset 1355).

Some people mentioned that mouseresize is really slow in dwm. The
following patch removes resize requests that have not been handled
before making a new one. For the benchmark of "hold down mouse button
and move pointer wildly", it does great. I'm sure it probably breaks
something else though...

diff -r 895c19c3a005 dwm.c
--- a/dwm.c Thu Sep 11 18:53:26 2008 -0700
+++ b/dwm.c Sun Sep 14 08:24:24 2008 -0700
@@ -1109,7 +1109,7 @@
int ocx, ocy;
int nw, nh;
Client *c;
- XEvent ev;
+ XEvent ev, tmp;

if(!(c = sel))
return;
@@ -1129,6 +1129,13 @@
handler[ev.type](&ev);
break;
case MotionNotify:
+ // remove resize events belonging to this
window: it doesn't
+ // need to process them.
+ // I should probably leave the mouse event in
the
+ // event queue...
+ while(XCheckMaskEvent(dpy, MOUSEMASK, &tmp));
+ while(XCheckWindowEvent(dpy, root,
PropertyChangeMask|StructureNotifyMask, &tmp));
+ while(XCheckWindowEvent(dpy, c->win,
PropertyChangeMask|StructureNotifyMask, &tmp));
XSync(dpy, False);
nw = MAX(ev.xmotion.x - NOBORDER(ocx) + 1, 1);
nh = MAX(ev.xmotion.y - NOBORDER(ocy) + 1, 1);
Anselm R Garbe
2008-09-14 20:12:46 UTC
Permalink
Post by Johannes Wegener
I recently read that awesome is going to use XCB over Xlib and says that
it is faster becouse it is asynchronous.
Does XCB realy its job faster than Xlib?
And if this is the case is dwm going to use XCB in any further release?
IMHO, asynchonicity probably only matters if you're using a bloated app over
a slow (network) connection. Since you're probably running your window
manager on your local machine, I'm not sure this will help dwm.
I agree.
What would make dwm fast is really to minimize the number of Map and Expose
events, so e.g. you don't render a Firefox window if it's unnecessary (cf.
changeset 1355).
Some people mentioned that mouseresize is really slow in dwm. The following
patch removes resize requests that have not been handled before making a new
one. For the benchmark of "hold down mouse button and move pointer wildly",
it does great. I'm sure it probably breaks something else though...
The problem with this approach is, that it will only filter the events
on the dwm side, but the X server might still send a similar amount of
expose events to the clients themselves, unfortunately. So the safest
way is to increase keeping the server grab to a value which is still
sufficient for client updates, but with better performance. That's the
optimal solution I have in mind, though it's tricky to adjust.

Kind regards,
--Anselm
Loading...