emacs-devel
[Top][All Lists]
Advanced

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

Re: [PATCH] Re: cc-mode fontification feels random


From: Eli Zaretskii
Subject: Re: [PATCH] Re: cc-mode fontification feels random
Date: Tue, 31 Aug 2021 16:23:08 +0300

> Date: Tue, 31 Aug 2021 10:54:23 +0000
> Cc: Daniel Colascione <dancol@dancol.org>, Eli Zaretskii <eliz@gnu.org>,
>   emacs-devel@gnu.org
> From: Alan Mackenzie <acm@muc.de>
> 
> For my current project (finding CC Mode "found types") stealth
> fontification is not ideal - what I need is a single pass through the
> whole buffer to detect the types, and that should be as fast as
> possible.  The current stealth fontification is not fast (it doesn't
> need to be) and carries on working until Emacs is shut down.

The purpose of jit-lock-stealth is different, that's why.

> So, it seems I want something like stealth, but not quite.

Yes, you want a different feature.

> How about, say jit-lock-single-fontification - it would apply to
> individual buffers only, would scan through the buffer precisely
> once, and would do just enough 500-byte chunks at at time to take
> 0.05 seconds (configurable).
> 
> On my machine in C Mode, approximately 100 chunks are fontified per
> second.  So if we had jit-lock-single-nice at 0.1 seconds, the time
> taken to scan xdisp.c would be approximately 1 to 1.5 minutes.  On a
> smaller file, say syntax.c (a tenth of the size) it would take 5 - 10
> seconds.  This is barely worse than context fontification, and would
> only happen at mode start up.

What happens if you unleash this jit-lock-single-fontification, and
then type at a relatively slow pace: does Emacs still feel responsive
enough?  And how much of CPU does it use in that case?



reply via email to

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