You are not logged in.

#1 2011-06-17 06:42:15

caminoix
Member
From: cracow, poland
Registered: 2005-07-12
Posts: 162
Website

[MOVED to another topic] XMonad slow start


Not an XMonad problem. Started a new topic here.

Hello,

for about a week now my XMonad starts very slowly. I can't think of anything that I did that could cause this problem. The only thing which I believe could be (remotely) relevant is installing Gnome, but I've always ran it as another user and never ran XMonad from that user's account.

Here's my .xinitrc:

# lower brightness (standard 1)
xgamma -gamma 0.8

# background
feh --bg-scale /home/kamil/.xmonad/background.png

# clipboard manager
clipit --no-icon &

# dzen
~/.dzen/dzen.sh &

# disable touchpad when typing
syndaemon -i 1 -t &

# sound off
amixer -q set Master off

# xmonad
exec xmonad

and my xmonad.hs:

import qualified XMonad.StackSet as W

import System.IO (hPutStrLn)
import XMonad
import XMonad.Config.Gnome
import XMonad.Hooks.DynamicLog
import XMonad.Hooks.ManageDocks
import XMonad.Layout.ResizableTile
import XMonad.Util.EZConfig (additionalKeys, additionalKeysP)
import XMonad.Util.Loggers (logCmd)
import XMonad.Util.Run (spawnPipe)


main = do
    statBarPipe <- spawnPipe myStateBar
    xmonad $ defaultConfig
        { -- hooks
          layoutHook    = myLayoutHook
        , logHook        = dynamicLogWithPP $ myStateBarPP statBarPipe
        , manageHook    = manageDocks <+> myManageHook <+> manageHook defaultConfig
          -- keys & mouse
        , modMask        = mod4Mask
          -- look
        , borderWidth    = 2
        , focusedBorderColor    = myColFgUrgent
        , normalBorderColor        = myColBgNormal
          -- workspaces
        , workspaces    = ["one", "two", "three", "four", "five", "six", "seven", "eight", "nine"]
        } `additionalKeysP` myKeys `additionalKeys`
            [ ((0, 0x1008ff11), spawn "amixer -q set Master 5%- unmute")
            , ((0, 0x1008ff12), spawn "amixer -q set Master mute")
            , ((0, 0x1008ff13), spawn "amixer -q set Master 5%+ unmute")
            ]

-- alternates
-- apps
-- myBrowser        = "google-chrome --enable-extensions --enable-plugins --enable-remote-fonts --enable-user-scripts"
myBrowser        = "chromium --enable-greasemonkey"
myPdfViewer        = "evince"
myRunner        = "exe=`dmenu_path | dmenu -b -nb '"++ myColBgNormal ++ "' -nf '" ++ myColFgNormal ++ "' -fn '" ++ myFont ++ "' -p '$'` && eval \"exec $exe\""
myRunnerRoot    = "exe=`dmenu_path | dmenu -b -nb '"++ myColBgNormal ++ "' -nf '" ++ myColFgNormal ++ "' -sb '" ++ myColFgUrgent ++ "' -fn '" ++ myFont ++ "' -p '#'` && eval \"exec sudo $exe\""
myStateBar        = "dzen2 -bg '" ++ myColBgNormal ++ "' -fn '" ++ myFont ++ "' -ta l -w 720 -h 24"
myTerminal        = "sakura"
myTextEditor    = "libreoffice"
-- look
myColBgNormal    = "#2a2b2f"
myColFgFocus    = "#62acce"
myColFgNormal    = "#e1e0e5"
myColFgUnimp    = "#67686b"
myColFgUrgent    = "#e6ac32"
myFont            = "-*-dax-light-r-normal-*-17-*-*-*-p-*-iso8859-1"


-- config
myKeys =
    [ -- xmonad
      ("M-<F1>", spawn myRunner)
    , ("M-<F3>", spawn myRunnerRoot)
    , ("M-f", withFocused $ windows . W.sink)
    , ("M-q", kill)
    , ("M-s", spawn "/home/kamil/.dzen/dzen-stats.sh")
    , ("M-S-r", restart "xmonad" True)
      -- apps
    , ("M-b", spawn myBrowser)
    , ("M-m", spawn (myBrowser ++ " www.gmail.com"))
    , ("M-p", spawn myPdfViewer)
    , ("M-t", spawn myTextEditor)
    , ("M-<Return>", spawn myTerminal)
      -- xkb
    , ("M-`", spawn "/home/kamil/conf/kbd/layout_switcher.sh often")
    , ("M-S-`", spawn "/home/kamil/conf/kbd/layout_switcher.sh menu")
    ]

myLayoutHook = avoidStruts (resizableTall ||| resizableWide) where
    resizableTall    = ResizableTall 1 (3/100) (1/2) []
    resizableWide    = ResizableTall 2 (3/100) (1/2) []

myManageHook = composeAll
    [ className    =? "Gimp"            --> doFloat
    , className =? "stalonetray"    --> doIgnore
    -- download windows
    , stringProperty "WM_WINDOW_ROLE"        =? "epiphany-download-manager"    --> doShift "nine"
    , className =? "Download"    --> doShift "nine"
    -- dialogs
    , stringProperty "WM_WINDOW_TYPE"        =? "_NET_WIM_WINDOW_TYPE_DIALOG" --> doFloat
    -- fontforge
    , stringProperty "WM_NAME"                =? "Layers"    --> doFloat
    , stringProperty "WM_NAME"                =? "Tools"    --> doFloat
    ]

myStateBarPP handle = defaultPP
    { -- content
      ppExtras    = []
    , ppOrder    = \(ws:l:t:e) -> [ws] ++ e
      -- look
    , ppCurrent    = dzenColor myColFgFocus ""
    , ppHidden    = dzenColor myColFgNormal ""
    , ppOutput    = hPutStrLn handle
    , ppSep        = " | "
    , ppUrgent    = dzenColor myColFgUrgent ""
    }

When I try to recompile the config, it returns no errors. It creates xmonad.errors but it's empty.

Only the first start is slow. If I restart X, or XMonad alone, it starts pretty fast, like it did before.

Can you help me, please?

Last edited by caminoix (2011-06-21 07:41:22)

Offline

#2 2011-06-19 22:53:52

caminoix
Member
From: cracow, poland
Registered: 2005-07-12
Posts: 162
Website

Re: [MOVED to another topic] XMonad slow start

Bump.

In case that matters: the time it takes to start for the first time is approximately as much as it needs to recompile. Might be pure coincidence, though.

Offline

#3 2011-06-20 00:20:27

listdata
Member
Registered: 2008-12-23
Posts: 102
Website

Re: [MOVED to another topic] XMonad slow start

Hello caminoix,

It's probably not XMonad that's suddenly slower than before; I don't have the same config as you, but I have not had any issues on any of my systems.

Two suggestions: (1) See how long the .xinitrc file takes to execute (your call to amixer is not backgrounded, for one) by echoing timestamped messages between each command:

# lower brightness (standard 1)
xgamma -gamma 0.8

echo "$(date): xgamma done" >> ~/my-startup-logfile

# background
feh --bg-scale /home/kamil/.xmonad/background.png

echo "$(date): feh done" >> ~/my-startup-logfile

...

# sound off
amixer -q set Master off

echo "$(date): amixer done" >> ~/my-startup-logfile

# xmonad
exec xmonad

This way you can isolate the problem more, before blaming XMonad first.

(2) Maybe some component of your xmonad.hs is indeed very slow for some reason. In this case, you should cut down your configuration one thing at a time until you get the normal speed back. For one, my config doesn't have any hooks for logging:

...
myEventHook = mempty
myLogHook = return ()
...

So you could try disabling logging first. Or maybe because you upgraded Gnome, the code from your "import XMonad.Config.Gnome" just got that much slower. (This would explain why xmonad is only slow on the first cold boot, but not on restarts (due to caching)). A simple method would be to just use the default, vanilla xmonad.hs and see the speed changes; if it's still slow, then it's definitely not an xmonad problem --- but if it's faster, then it's a problem within your original xmonad.hs file.

Good luck on your bug hunt...

Offline

#4 2011-06-20 20:23:53

caminoix
Member
From: cracow, poland
Registered: 2005-07-12
Posts: 162
Website

Re: [MOVED to another topic] XMonad slow start

Thank you for the suggestions but I'm afraid the problem is somewhere else.

(1) Everything before xmonad in my .xinitrc starts pretty fast:

Mon Jun 20 21:49:33 CEST 2011: xgamma
Mon Jun 20 21:49:34 CEST 2011: feh
Mon Jun 20 21:49:34 CEST 2011: clipit
Mon Jun 20 21:49:34 CEST 2011: dzen
Mon Jun 20 21:49:34 CEST 2011: syndaemon
Mon Jun 20 21:49:39 CEST 2011: amixer

(2) I tried both the vanilla xmonad.hs and the minimal version:

import XMonad
main = xmonad $ defaultConfig

but there was no noticeable difference in the starting time.

I also tried reinstalling xmonad and xmonad-contrib; no luck. I did a quick check with scrotwm; it started in an instant.

Any ideas, please?

Offline

#5 2011-06-20 20:43:01

listdata
Member
Registered: 2008-12-23
Posts: 102
Website

Re: [MOVED to another topic] XMonad slow start

Very strange, indeed. There is no noticeable speed difference between the different xmonad.hs configs, yet if you switch to another WM (scrotwm) it starts instantly...

Hmm, before we say it's an xmonad problem: did you explicitly give the "xmonad --recompile; xmonad --restart" command for the minimal config? If all you did was just change the config and then reboot once, then when it started up it had to compile the xmonad.hs again, so it must have taken longer than need be (especially so on slow machines). Try the minimal config (the same 2-liner you posted) and explicitly recompile it, then reboot and see if it's still slow.

If it's still slow, then, I guess xmonad is slow after all (for your system)...? Post your hardware/video driver/kernel specs.

Offline

#6 2011-06-20 21:11:34

caminoix
Member
From: cracow, poland
Registered: 2005-07-12
Posts: 162
Website

Re: [MOVED to another topic] XMonad slow start

Yes, I did an explicit "xmonad --recompile" and "--restart" a couple of times, including between changing the config and rebooting. I also checked "ls -l" and md5summed ~/,xmonad/xmonad-x86_64-linux and /usr/bin/xmonad before and after rebooting. Nothing has changed.

I am sure XMonad doesn't have to be slow on my machine. It ran just fine for about two years up until some ten days ago. I didn't do anything to the config around that time.

My specs are:
Dell Studio 1737
Intel Core 2 Duo P8400 2.26 GHz
ATI Mobility Radeon HD 3650 (xf86-video-ati)
kernel 2.6.39-ARCH (default)

Offline

#7 2011-06-20 21:48:13

davvil
Member
Registered: 2008-05-06
Posts: 165

Re: [MOVED to another topic] XMonad slow start

caminoix wrote:

Bump.

In case that matters: the time it takes to start for the first time is approximately as much as it needs to recompile. Might be pure coincidence, though.

Hmm, wild guess, but could it be that xmonad is indeed recompiling the config each time it starts? I don't know exactly what logic xmonad uses to decide when to recompile, probably looking at the timestamps of the config and the executable. Could you check the timestamps of both files before starting X?

Offline

#8 2011-06-20 22:32:46

caminoix
Member
From: cracow, poland
Registered: 2005-07-12
Posts: 162
Website

Re: [MOVED to another topic] XMonad slow start

I checked with "ls --full-time" and it definitely seems that it is not recompiling.

But: I installed XFCE, created another user account and set inittab to login as that user and start XFCE. There was this same lag again.

Summing up:

  1. The lag is independent of XMonad and my user account.

  2. It only happens after a reboot. After restarting X, restarting the wm, logging in and out or logging in as another user, everything goes smoothly.

  3. It only affects the wm/de. Whatever is there in .xinitrc before the wm (feh, dzen, kupfer &c.) starts at normal speed.

  4. It is independent of whether the daemons in rc.conf are backgrounded or not (syslog-ng cpufreq dbus @net-auto-wireless @laptop-mode @crond @alsa @sensors).

Should I change the title of the topic or would that be confusing?

Offline

#9 2011-06-21 02:12:26

listdata
Member
Registered: 2008-12-23
Posts: 102
Website

Re: [MOVED to another topic] XMonad slow start

caminoix wrote:

I checked with "ls --full-time" and it definitely seems that it is not recompiling.

But: I installed XFCE, created another user account and set inittab to login as that user and start XFCE. There was this same lag again.

Summing up:

  1. The lag is independent of XMonad and my user account.

  2. It only happens after a reboot. After restarting X, restarting the wm, logging in and out or logging in as another user, everything goes smoothly.

  3. It only affects the wm/de. Whatever is there in .xinitrc before the wm (feh, dzen, kupfer &c.) starts at normal speed.

  4. It is independent of whether the daemons in rc.conf are backgrounded or not (syslog-ng cpufreq dbus @net-auto-wireless @laptop-mode @crond @alsa @sensors).

Should I change the title of the topic or would that be confusing?

Well, if there are speed issues even without Xmonad (on XFCE as you mentioned) then it's not an Xmonad problem! You should just start a new thread and post a link to it.

BTW, you should stress the fact that it's slower than before the upgrade, rather than the fact that restarting X alone or logging in/out is faster than a cold boot login (which is usually the case for everyone).

Offline

#10 2011-06-21 07:39:22

caminoix
Member
From: cracow, poland
Registered: 2005-07-12
Posts: 162
Website

Re: [MOVED to another topic] XMonad slow start

listdata wrote:

Well, if there are speed issues even without Xmonad (on XFCE as you mentioned) then it's not an Xmonad problem! You should just start a new thread and post a link to it.

Right. New topic started here. Thank you for help!

Offline

Board footer

Powered by FluxBB