[xmonad] darcs patch: X.H.UrgencyHook: performance fix
Don Stewart
dons at galois.com
Mon Mar 29 12:43:57 EDT 2010
tomi:
> Sat Mar 27 21:15:03 CET 2010 Tomas Janousek <tomi at nomi.cz>
> * X.H.UrgencyHook: performance fix
>
> cleanupUrgents would update the Map in extensible state 2-times the number of
> visible windows, resulting in excessive memory usage and garbage collection.
> This seems to make it behave correctly.
>
>
> Note: this is actually not necessary after the fix to core I just posted, but
> it should speed things up a little if one has hundreds of visible windows.
> --
> Tomáš Janoušek, a.k.a. Liskni_si, http://work.lisk.in/
>
> New patches:
>
> [X.H.UrgencyHook: performance fix
> Tomas Janousek <tomi at nomi.cz>**20100327201503
> Ignore-this: e62c1cdc752c510f2fe1f7dc3bef3db5
>
> cleanupUrgents would update the Map in extensible state 2-times the number of
> visible windows, resulting in excessive memory usage and garbage collection.
> This seems to make it behave correctly.
> ] {
> hunk ./XMonad/Hooks/UrgencyHook.hs 82
> import Control.Applicative ((<$>))
> import Control.Monad (when)
> import Data.Bits (testBit)
> -import Data.List (delete)
> +import Data.List (delete, (\\))
> import Data.Maybe (listToMaybe, maybeToList)
> import qualified Data.Set as S
>
> hunk ./XMonad/Hooks/UrgencyHook.hs 375
> shouldSuppress sw w = elem w <$> suppressibleWindows sw
>
> cleanupUrgents :: SuppressWhen -> X ()
> -cleanupUrgents sw = mapM_ clearUrgency =<< suppressibleWindows sw
> +cleanupUrgents sw = do
> + sw' <- suppressibleWindows sw
> + adjustUrgents (\\ sw') >> adjustReminders (filter $ (not . (`elem` sw') . window))
Perhaps use notElem ?
-- Don
More information about the xmonad
mailing list