Loading ...
Sorry, an error occurred while loading the content.
 

[PATCH] Redraws slow down proportionately to the number of open tabs in gvim/win32

Expand Messages
  • Arseny Kapoulkine
    gui_mch_update_tabline in Windows gvim is quadratic in the number of tabs. This happens because the entire control is redrawn after every
    Message 1 of 3 , Oct 3, 2012
      gui_mch_update_tabline in Windows gvim is quadratic in the number of tabs. This happens because the entire control is redrawn after every InsertItem/SetItem/DeleteItem message. The delay starts to get *really* noticeable at 60 open tabs or so (Windows 7).

      Note that disabling redraws during the update is not enough - the code used GetTabItemRect to check if the item is present; however, this forces the tab control to recompute the layout after every change, which still results in quadratic behavior.

      The attached patch fixes the issue.

      --
      You received this message from the "vim_dev" 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
    • Bram Moolenaar
      ... Thanks, I ll add it to the todo list. I do wonder how you can work with 60 open tabs... -- Girls are like internet domain names, the ones I like
      Message 2 of 3 , Oct 4, 2012
        Arseny Kapoulkine wrote:

        > gui_mch_update_tabline in Windows gvim is quadratic in the number of
        > tabs. This happens because the entire control is redrawn after every
        > InsertItem/SetItem/DeleteItem message. The delay starts to get
        > *really* noticeable at 60 open tabs or so (Windows 7).
        >
        > Note that disabling redraws during the update is not enough - the code
        > used GetTabItemRect to check if the item is present; however, this
        > forces the tab control to recompute the layout after every change,
        > which still results in quadratic behavior.
        >
        > The attached patch fixes the issue.

        Thanks, I'll add it to the todo list.

        I do wonder how you can work with 60 open tabs...


        --
        <Beeth> Girls are like internet domain names,
        the ones I like are already taken.
        <honx> Well, you can stil get one from a strange country :-P

        /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
        /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
        \\\ an exciting new programming language -- http://www.Zimbu.org ///
        \\\ help me help AIDS victims -- http://ICCF-Holland.org ///

        --
        You received this message from the "vim_dev" 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
      • Ken Takata
        Hi Arseny, ... After applying your patch, the variable rc is no more used in the function gui_mch_update_tabline(). diff --git a/src/gui_w48.c b/src/gui_w48.c
        Message 3 of 3 , Oct 23, 2012
          Hi Arseny,

          2012/10/4 Thu 15:13:56 UTC+9 Arseny Kapoulkine:
          > gui_mch_update_tabline in Windows gvim is quadratic in the number of tabs. This happens because the entire control is redrawn after every InsertItem/SetItem/DeleteItem message. The delay starts to get *really* noticeable at 60 open tabs or so (Windows 7).
          >
          > Note that disabling redraws during the update is not enough - the code used GetTabItemRect to check if the item is present; however, this forces the tab control to recompute the layout after every change, which still results in quadratic behavior.
          >
          > The attached patch fixes the issue.

          After applying your patch, the variable rc is no more used in
          the function gui_mch_update_tabline().

          diff --git a/src/gui_w48.c b/src/gui_w48.c
          --- a/src/gui_w48.c
          +++ b/src/gui_w48.c
          @@ -2446,7 +2446,6 @@
          TCITEM tie;
          int nr = 0;
          int curtabidx = 0;
          - RECT rc;
          #ifdef FEAT_MBYTE
          static int use_unicode = FALSE;
          int uu;

          Thanks,
          Ken Takata

          --
          You received this message from the "vim_dev" 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
        Your message has been successfully submitted and would be delivered to recipients shortly.