[xmonad] Decoration rewrite

Norbert Zeh nzeh at cs.dal.ca
Sun Feb 12 22:54:50 CET 2012

Hi folks,

I have just finished a rewrite of XMonad.Layout.Decoration to improve its
performance.  There were a number of places in the code which took quadratic
time in the number of windows in the layout.  I got all this down to O(n log n)
by converting uses of plain old lists to uses of Data.Map.  Unfortunately, this
change was not possible without changing the interface of the methods of the
DecorationStyle type class.  Thus, I had to fix all the modules (quite a few)
that use Decoration to use the new interface.  I'm done but need to test that
everything behaves as expected before I push the patch.  I'll also have to test
how much faster the rewritten module actually is.

The reason why I'm writing about this *before* putting the effort into testing
all my changes is that I'd like to know how the community feels about a change
in the interface of the DecorationStyle type class.  As it is, there are only
two choices: accept this change or continue to live with quadratic-time
behaviour of all or at least most decoration modules because the latter is
unavoidable with the current interface.  This change in interface should only
affect other modules in XMonadContrib, and I've converted them to the new
interface already.  User configurations should not be affected even for the
majority of people who use window decorations because they will normally simply
use the layout modifiers based on the decoration module - they will not directly
use the DecorationStyle class.

If a patch with the reimplementation of X.L.Decoration will not be rejected
because of breaking the current API, then I'll continue working on this over the
next little while and send the patch when I've convinced myself that things
continue to work as before...only more efficiently ;)


More information about the xmonad mailing list