Friday, May 7, 2021

RedHat Athena: GUI vim is extremely slow using terminal

Hi,

We have Red Hat Enterprise Linux Server release 7.8 (Maipo), which by default has vim 7.4 installed. I am trying to compile the latest vim 8.2 (official release, without later patches). I went the usual way: download the sources, configure (default settings, only --prefix redefined), make, make install ... And got the following build:

======================================================================
VIM - Vi IMproved 8.2 (2019 Dec 12, compiled May  7 2021 15:42:09)
Compiled by xxxxxxxxxxx
Huge version with X11-Athena GUI.  Features included (+) or not (-):
+acl               -farsi             -mouse_sysmouse    -tag_old_static
+arabic            +file_in_path      +mouse_urxvt       -tag_any_white
+autocmd           +find_in_path      +mouse_xterm       -tcl
+autochdir         +float             +multi_byte        +termguicolors
-autoservername    +folding           +multi_lang        +terminal
+balloon_eval      -footer            -mzscheme          +terminfo
+balloon_eval_term +fork()            +netbeans_intg     +termresponse
+browse            +gettext           +num64             +textobjects
++builtin_terms    -hangul_input      +packages          +textprop
+byte_offset       +iconv             +path_extra        +timers
+channel           +insert_expand     -perl              +title
+cindent           +job               +persistent_undo   +toolbar
+clientserver      +jumplist          +popupwin          +user_commands
+clipboard         +keymap            +postscript        +vartabs
+cmdline_compl     +lambda            +printer           +vertsplit
+cmdline_hist      +langmap           +profile           +virtualedit
+cmdline_info      +libcall           -python            +visual
+comments          +linebreak         -python3           +visualextra
+conceal           +lispindent        +quickfix          +viminfo
+cryptv            +listcmds          +reltime           +vreplace
+cscope            +localmap          +rightleft         +wildignore
+cursorbind        -lua               -ruby              +wildmenu
+cursorshape       +menu              +scrollbind        +windows
+dialog_con_gui    +mksession         +signs             +writebackup
+diff              +modify_fname      +smartindent       +X11
+digraphs          +mouse             -sound             +xfontset
-dnd               +mouseshape        +spell             +xim
-ebcdic            +mouse_dec         +startuptime       +xpm
+emacs_tags        -mouse_gpm         +statusline        +xsmp_interact
+eval              -mouse_jsbterm     -sun_workshop      +xterm_clipboard
+ex_extra          +mouse_netterm     +syntax            -xterm_save
+extra_search      +mouse_sgr         +tag_binary        
   system vimrc file: "$VIM/vimrc"
     user vimrc file: "$HOME/.vimrc"
 2nd user vimrc file: "~/.vim/vimrc"
      user exrc file: "$HOME/.exrc"
  system gvimrc file: "$VIM/gvimrc"
    user gvimrc file: "$HOME/.gvimrc"
2nd user gvimrc file: "~/.vim/gvimrc"
       defaults file: "$VIMRUNTIME/defaults.vim"
    system menu file: "$VIMRUNTIME/menu.vim"
  fall-back for $VIM: "xxxxxxx/vim"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_ATHENA -DFUNCPROTO=15 -DNARROWPROTO    -g -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1       
Linking: gcc   -L/usr/local/lib -Wl,--as-needed -o vim -lXaw -lXmu -lXext -lXt -lSM -lICE -lXpm -lXt -lX11 -lSM -lICE -ldl  -lm -ltinfo -lnsl  -lselinux -ldl           
======================================================================

The problem with this build is that the GUI version is very slow. For example, it takes about 6 sec to start. Below are some unnecessary large timings from the startup profiling:

==================================================
161.380  159.404: expanding arguments
...
1344.137  1143.949  1143.949: sourcing .../share/vim/vim82/ftplugin/man.vim
...
5302.964  3903.539: starting GUI
==================================================

Once started, gvim more or less works, until I decide to use the terminal functionality. This is where the things become really indecent. Forget using the terminal interactively, a simple ":term ls -l" takes several minutes to run. Gvim is unresponsive during this time. Once the terminal window becomes finished, gvim becomes responsive again, but will periodically hang if you decide to navigate in the finished terminal window. During gvim hanging, the call stack looks like this:

==================================================
PID 2468 - process
TID 2468:
#0  0x00007f3469b62c20     poll - /usr/lib64/libc-2.17.so
#1  0x00007f346943c022 - 1 _xcb_conn_wait - /usr/lib64/libxcb.so.1.1.0
#2  0x00007f346943d99f - 1 wait_for_reply - /usr/lib64/libxcb.so.1.1.0
#3  0x00007f346943db12 - 1 xcb_wait_for_reply64 - /usr/lib64/libxcb.so.1.1.0
#4  0x00007f346a7d70f0 - 1 _XReply - /usr/lib64/libX11.so.6.3.0
#5  0x00007f346a7bbd3f - 1 XAllocColor - /usr/lib64/libX11.so.6.3.0
#6  0x00000000005d238a - 1 - .../usr/local/bin/vim
#7  0x000000000059537a - 1 - .../usr/local/bin/vim
#8  0x0000000000595d1c - 1 - .../usr/local/bin/vim
#9  0x000000000059c73e - 1 - .../usr/local/bin/vim
#10 0x000000000043db48 - 1 - .../usr/local/bin/vim
#11 0x000000000043fba5 - 1 - .../usr/local/bin/vim
#12 0x00000000005fbf5c - 1 - .../usr/local/bin/vim
#13 0x00000000005fd17a - 1 - .../usr/local/bin/vim
#14 0x000000000040bcb2 - 1 - .../usr/local/bin/vim
#15 0x00007f3469a91555 - 1 __libc_start_main - /usr/lib64/libc-2.17.so
#16 0x000000000040d6f4 - 1 - .../usr/local/bin/vim
==================================================

Which makes me thing that the problem is GUI/X server related. And true, this does not happen in the console verion of vim.  FYI, My X server is one of the latest versions of vcxsrv running on Win 10.

I believe that the version of vim 7.4 that comes preinstalled is faster. Unfortunately, vim 7.4 does not have the terminal functionality to compare the same things, but its start-up times are much faster, without the lags above (same vimrc is used). The vim 7.4 is built with -DFEAT_GUI_GTK and various gtk header folders included. I don't have those headers on my server, that's why GTK GUI is not used by configure...

Any advice would be appreciated.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/24fcfb04-66e2-44f2-a3fb-21b274c11337n%40googlegroups.com.

No comments:

Post a Comment