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

58 views
Skip to first unread message

Bram Moolenaar

unread,
Oct 4, 2012, 5:14:51 PM10/4/12
to Arseny Kapoulkine, vim...@googlegroups.com

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 -- Br...@Moolenaar.net -- 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 ///

Ken Takata

unread,
Oct 23, 2012, 6:44:55 PM10/23/12
to vim...@googlegroups.com
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

Reply all
Reply to author
Forward
0 new messages