emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: emacs rendering comparisson between emacs23 and emacs26.3


From: Alan Mackenzie
Subject: Re: emacs rendering comparisson between emacs23 and emacs26.3
Date: Sun, 5 Apr 2020 19:57:53 +0000

Hello, Dmitry.

On Sun, Apr 05, 2020 at 21:05:00 +0300, Dmitry Gutov wrote:
> On 05.04.2020 19:15, Eli Zaretskii wrote:
> >> Do you at least see CPU activity significantly go up when you do such
> >> mouse wheel scrolling?
> > With what build?  With the -O0 build with --enable-checking, I don't
> > need the mouse: it's enough to lean on C-v and let the keyboard
> > auto-repeat do its job -- one execution unit of the CPU maxes out
> > after 5 to 10 C-v's.

> > But with a -O2 optimized production build, Emacs keeps up both when I
> > lean on C-v and when I turn the mouse wheel constantly.

> Same here. And much as I like to see certain modes improved, I'm not 
> sure this is only a performance problem. Because no matter how fast 
> syntax highlighting is, you can lean on C-v faster.

> IIRC, redisplay-dont-pause was supposed to help with things like this. 
> But it doesn't (and it's obsolete), and apparently jit-lock does its 
> thing anyway. This looks like the interesting part of the profile:

>      - scroll-up                                              5657  73%
>       - jit-lock-function                                     5444  70%
>        - jit-lock-fontify-now                                 5439  70%
>         + jit-lock--run-functions                             5431  70%
>         + run-with-timer                                         5   0%

> Do you guys want to try (setq jit-lock-defer-time 0)? It comes with a 
> certain visual downside, though.

> Or, alternatively, (setq fast-but-imprecise-scrolling t). This var seems 
> like a good idea in general, so we might consider going further with it.

Try this:

diff --git a/src/window.c b/src/window.c
index 8cdad27b66..b23ae41aba 100644
--- a/src/window.c
+++ b/src/window.c
@@ -5475,7 +5475,9 @@ window_scroll (Lisp_Object window, EMACS_INT n, bool 
whole, bool noerror)
 
   wset_redisplay (XWINDOW (window));
 
-  if (whole && Vfast_but_imprecise_scrolling)
+  if (Vfast_but_imprecise_scrolling
+      && (whole
+          || EQ (Vthis_command, Qmwheel_scroll)))
     specbind (Qfontification_functions, Qnil);
 
   /* On GUI frames, use the pixel-based version which is much slower
@@ -8173,6 +8175,7 @@ syms_of_window (void)
   DEFSYM (Qmode_line_format, "mode-line-format");
   DEFSYM (Qheader_line_format, "header-line-format");
   DEFSYM (Qtab_line_format, "tab-line-format");
+  DEFSYM (Qmwheel_scroll, "mwheel-scroll");
 
   DEFVAR_LISP ("temp-buffer-show-function", Vtemp_buffer_show_function,
               doc: /* Non-nil means call as function to display a help buffer.


This eliminates all the delay I formerly saw while mouse scrolling as
fast as possibly.

-- 
Alan Mackenzie (Nuremberg, Germany).



reply via email to

[Prev in Thread] Current Thread [Next in Thread]