GNU bug report logs - #52298
29.0.50; Frequent redisplay cycles induced by c-type-finder-timer-func timer in CC Mode

Previous Next

Package: emacs;

Reported by: Eli Zaretskii <eliz <at> gnu.org>

Date: Sun, 5 Dec 2021 07:47:02 UTC

Severity: normal

Found in version 29.0.50

Done: Alan Mackenzie <acm <at> muc.de>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: Alan Mackenzie <acm <at> muc.de>
Cc: acm <at> muc.de, 52298 <at> debbugs.gnu.org
Subject: bug#52298: 29.0.50; Frequent redisplay cycles induced by c-type-finder-timer-func timer in CC Mode
Date: Tue, 07 Dec 2021 22:16:28 +0200
> Date: Tue, 7 Dec 2021 19:58:39 +0000
> Cc: 52298 <at> debbugs.gnu.org, acm <at> muc.de
> From: Alan Mackenzie <acm <at> muc.de>
> 
> > 18 seconds is almost an eternity for my frequent use cases of firing
> > up Emacs to debug some display problem.  And it's much more than 18
> > sec here: I measured 4 minutes and 21 sec, with 1:54 CPU time.  My
> > build is unoptimized, but still, a factor of 13 wrt your timing is too
> > much to be explained by that alone.
> 
> Is that with xdisp.c the only CC Mode buffer?

Yes.  Not only the only CC Mode buffer: the only Emacs buffer except
8scratch* and *Messages*.  It's "emacs -Q" that just visited xdisp.c.

> That 4 minutes 21 seconds - does the thrashing of the redisplay stop
> after this amount of uptime?

Yes.  After that, all I see is the timer running, which forces
frequent entries to redisplay (something to remember: frequent timers
cause frequent entries to redisplay), but it immediately exits without
doing anything.

> As a matter of interest, is Emacs responsive to key strokes when this is
> happening?

It's responsive, but it "stutters": if I lean on the right-arrow key,
it doesn't move with uniformly constant velocity, but instead
frequently stops for a split-second.

> What changes in the buffer is the detection of "foo", "bar", ... as
> found types.  These get marked throughout the buffer with the fontified
> text property set to nil, and if an occurrence is in a displayed window,
> that triggers an immediate redisplay to refontify that visible
> occurrence of the found type.  I think this repeated redisplay is
> happening too often.

And I think it happens not only for the fontified property set on the
visible portion of the buffer, but also on the portions that are
outside of the window.  In fact, the output of trace-redisplay clearly
tells me that redisplay was called when all the changes were after the
window's end.  Which is expected, given that the window shows the
first portion of the file.

Is your code using with-silent-modifications, or some other mechanism
that should prevent Emacs from thinking that the buffer has changed?
If not, why not?




This bug report was last modified 3 years and 212 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.