awesomeWM / awesome

awesome window manager
https://awesomewm.org/
GNU General Public License v2.0
6.34k stars 597 forks source link

vim start-up slow when trying to connect to X server #2734

Open CDitzel opened 5 years ago

CDitzel commented 5 years ago

After a fresh install of ubuntu 18.04 I notice that opening vim or gvim takes up to 2 seconds while being in awesome wm. If I log in to the gnome desktop instead, the behaviour is back to normal and vim starts up fast. I did not change anything in my awesome config.

Running gvim -X in the shell also works and is fast. Only if I omit the -X it is slow

What could be the problem? thank you in advance

psychon commented 5 years ago

Do I understand this correctly:

And similarly:

blueyed commented 5 years ago

Try if using -X helps:

-X Do not connect to X server

psychon commented 5 years ago

@blueyed

Running gvim -X in the shell also works and is fast. Only if I omit the -X it is slow

blueyed commented 5 years ago

Reminded me of https://github.com/awesomeWM/awesome/issues/2717 then.

psychon commented 5 years ago

What could be the problem?

I don't know, but you could run vim/gvim under strace with option -f -tt or x11trace/xtrace with option --relative-timestamps in the hope of figuring out what the slow part is. Also, gdb might help in figuring out what vim is waiting for. However, I guess none of these options are trivial to use.

blueyed commented 5 years ago

I am pretty sure that it is Vim not being able to connect, and stopping after 2s then (https://github.com/vim/vim/blob/63dbfd33c1d47400c62775842b5b750ee69e2383/src/os_unix.c#L1817).

CDitzel commented 5 years ago

thank you guys for your input. How can I fix that?

psychon commented 5 years ago

Well... do you have strace? If so, can you run things under strace -tt -o /tmp/trace.txt and provide the resulting trace? Perhaps that tells us where exactly this hang... hangs. Besides that, all of the ideas above still stand.