1. Frank Fischer
  2. evil
Issue #268 resolved

evil-resize-window is slow

Scott Determan
created an issue

Commands like c-w_ and c-w| seem to take a very long time. I looked at the code and the function evil-resize-window is coded in a way that calls enlarge-window (or shrink-window) once for every requested size delta. I'm sure there is a reason it is coded this way, but it makes commands c-w_ uncomfortably slow.

In my local version, I changed this function so it calls enlarge-window once for a requested delta. With this chance c-w_ and c-w| are much faster.

Comments (4)

  1. Frank Fischer repo owner

    Improve performance of evil-resize-window (fix #268)

    In Emacs <= 23 the function enlarge-window may delete other windows. Because of this evil-resize-window changed the size of a window in steps of one, checking whether the window configuration changed. This may be very inefficient.

    In Emacs 24 enlarge-window does not delete other windows anymore, so we can use this function directly. In Emacs 23 we use inhibit-redisplay to prevent Emacs from redisplaying during the resizing process, which should improve the performance.

    → <<cset 8f3a5f66ffa6>>

  2. Frank Fischer repo owner

    The reason for this was the strange behaviour of enlarge-window in Emacs 23 to possibly delete other windows. It would be nice if you could check if the performance problem still occurs in Emacs 23, too.

  3. Frank Fischer repo owner

    Improve performance of evil-resize-window (fix #268)

    In Emacs <= 23 the function enlarge-window may delete other windows. Because of this evil-resize-window changed the size of a window in steps of one, checking whether the window configuration changed. This may be very inefficient.

    In Emacs 24 enlarge-window does not delete other windows anymore, so we can use this function directly. In Emacs 23 we use inhibit-redisplay to prevent Emacs from redisplaying during the resizing process, which should improve the performance.

    → <<cset 8f3a5f66ffa6>>

  4. Log in to comment