From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs 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 Message-ID: <83k0ggxjab.fsf@gnu.org> References: <83sfv74hpm.fsf@gnu.org> <83pmq8zi5b.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="38079"; mail-complaints-to="usenet@ciao.gmane.io" Cc: acm@muc.de, 52298@debbugs.gnu.org To: Alan Mackenzie Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Dec 07 21:17:39 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1muguB-0009h2-7M for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 07 Dec 2021 21:17:39 +0100 Original-Received: from localhost ([::1]:54838 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mugu9-0006jz-To for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 07 Dec 2021 15:17:37 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:60498) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mugtm-0006j0-Dz for bug-gnu-emacs@gnu.org; Tue, 07 Dec 2021 15:17:16 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:55433) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mugtb-0004o0-9q for bug-gnu-emacs@gnu.org; Tue, 07 Dec 2021 15:17:11 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mugtb-0001ta-5Z for bug-gnu-emacs@gnu.org; Tue, 07 Dec 2021 15:17:03 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 07 Dec 2021 20:17:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 52298 X-GNU-PR-Package: emacs Original-Received: via spool by 52298-submit@debbugs.gnu.org id=B52298.16389082077210 (code B ref 52298); Tue, 07 Dec 2021 20:17:03 +0000 Original-Received: (at 52298) by debbugs.gnu.org; 7 Dec 2021 20:16:47 +0000 Original-Received: from localhost ([127.0.0.1]:38737 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mugtK-0001sE-NB for submit@debbugs.gnu.org; Tue, 07 Dec 2021 15:16:46 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:59612) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mugtH-0001rt-PO for 52298@debbugs.gnu.org; Tue, 07 Dec 2021 15:16:44 -0500 Original-Received: from [2001:470:142:3::e] (port=56678 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mugt9-0004QU-Ro; Tue, 07 Dec 2021 15:16:38 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=a2auO/nwZSDjxRcsqAvT13WhRgORid2rRX6XHDSgGe8=; b=RV34eUmfmRhy XUvqgUeuXvSv7vlU6RGRXrTfDSy0bRFi68j0JqxENkssby1fsnKncMlzdRMOixd3m1ug2c0EukqWK BTjsc67l9kxVeibkbLXECkBpdMBSZjQymHSnIRZScD77dhM9Ty7ks7ViKlgR/mUCQF4f7actXqGZ3 +7InYS8UcvWmnMH3osUI4cy4esXUW0WHB42vQCGBF624QwDRQYHTgaBLdUg5V5+0rosMAPY905j4d et+xOSqr7BE/TxrW+//LrKEKqV0/FRw+AnIW97C1U9xGWWDNwfCAHCpkjHbHHIJ21lw8YhLkCbvtb uPiXJGy5GfllBVNiKfKIkA==; Original-Received: from [87.69.77.57] (port=3511 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mugt9-0005Qi-Km; Tue, 07 Dec 2021 15:16:35 -0500 In-Reply-To: (message from Alan Mackenzie on Tue, 7 Dec 2021 19:58:39 +0000) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:221871 Archived-At: > Date: Tue, 7 Dec 2021 19:58:39 +0000 > Cc: 52298@debbugs.gnu.org, acm@muc.de > From: Alan Mackenzie > > > 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?