emacs-devel
[Top][All Lists]
Advanced

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

Re: bug-reference-prog-mode slows down CC Mode's scrolling by ~7%


From: Alan Mackenzie
Subject: Re: bug-reference-prog-mode slows down CC Mode's scrolling by ~7%
Date: Mon, 6 Sep 2021 10:46:48 +0000

Hello, Eli and Stefan.

On Sat, Sep 04, 2021 at 19:15:08 +0300, Eli Zaretskii wrote:
> > Date: Sat, 4 Sep 2021 16:05:44 +0000
> > Cc: monnier@iro.umontreal.ca, emacs-devel@gnu.org
> > From: Alan Mackenzie <acm@muc.de>

> > My previous timings were on a Linux console tty.  Moving to X, and
> > starting Emacs with emacs --no-desktop, I get 34 Lines and 80 columns.
> > With my new propose jit-lock code I get the following timings with these
> > jit-lock-chunk-sizes:

> > (500): 24.5s
> > (2000): 18.0s
> > (8000): 16.4s

> > ..  So it would seem, at least in CC Mode, a larger jit-lock-chunk-size is
> > advantageous on a default size GUI Emacs, too.

> Yes, I guess we should increase the default.

I think the optimal size for jit-lock-chunk-size is a little over how
much text fits in a window.  That way, an entire window can be fontified
in a single chunk, minimising overhead.  However, much more than that,
and the fontification is less JIT, more like fontifying large chunks of
a buffer just in case.

So, I propose a default value of 2000.  Approximately 1700 characters of
xdisp.c fit into a default sized GUI window.  I think the doc string
should say a little more.

So, how about:



diff --git a/lisp/jit-lock.el b/lisp/jit-lock.el
index a1287926eb..4c612a6398 100644
--- a/lisp/jit-lock.el
+++ b/lisp/jit-lock.el
@@ -44,10 +44,13 @@ jit-lock
   :version "21.1"
   :group 'font-lock)
 
-(defcustom jit-lock-chunk-size 500
+(defcustom jit-lock-chunk-size 2000
   "Jit-lock fontifies chunks of at most this many characters at a time.
 
-This variable controls both display-time and stealth fontification."
+This variable controls both display-time and stealth fontification.
+
+The optimum value is a little over the typical number of buffer
+characters which fit in a window."
   :type 'integer)
 
 


> Thanks.

-- 
Alan Mackenzie (Nuremberg, Germany).



reply via email to

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