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#57207: 29.0.50; Fontification is slow after e7b5912b23 (Improvements to long lines handling) Date: Tue, 16 Aug 2022 15:43:31 +0300 Message-ID: <83o7wkfjf0.fsf@gnu.org> References: <87bksmx1j1.fsf@localhost> <5900f208367791fbdfe2@heytings.org> <83bksmka08.fsf@gnu.org> <325f95fd2b7c0cc80613@heytings.org> <83y1voflmb.fsf@gnu.org> <325f95fd2bce114fd74d@heytings.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="4338"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 57207@debbugs.gnu.org, yantar92@gmail.com To: Gregory Heytings Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Aug 16 14:54:54 2022 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 1oNw5t-0000QM-Rz for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 16 Aug 2022 14:54:53 +0200 Original-Received: from localhost ([::1]:37798 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oNvw2-0005fW-Sm for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 16 Aug 2022 08:44:42 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:55844) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oNvvO-0004nk-FX for bug-gnu-emacs@gnu.org; Tue, 16 Aug 2022 08:44:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:55470) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oNvvO-0004Hf-6K for bug-gnu-emacs@gnu.org; Tue, 16 Aug 2022 08:44:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oNvvO-0008WA-2f for bug-gnu-emacs@gnu.org; Tue, 16 Aug 2022 08:44:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 16 Aug 2022 12:44:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 57207 X-GNU-PR-Package: emacs Original-Received: via spool by 57207-submit@debbugs.gnu.org id=B57207.166065383132708 (code B ref 57207); Tue, 16 Aug 2022 12:44:02 +0000 Original-Received: (at 57207) by debbugs.gnu.org; 16 Aug 2022 12:43:51 +0000 Original-Received: from localhost ([127.0.0.1]:45218 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oNvvC-0008VT-SF for submit@debbugs.gnu.org; Tue, 16 Aug 2022 08:43:51 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:42906) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oNvvA-0008VG-Kz for 57207@debbugs.gnu.org; Tue, 16 Aug 2022 08:43:48 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:47394) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oNvv5-0004GO-Ci; Tue, 16 Aug 2022 08:43:43 -0400 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=EJQ6FVYPgEGlzV55KsJLPEAvNsTXRhTEREZwfb7lYsA=; b=S0MyAsbsV8fm MYFLwUKYD/WyrjmjnTpUWf0rVqYanO3fAwN3t8T7b30etnLy24XjDtG2EXZTuHqd9+qu9Tm98bvLw 3SOefEBQVZgj5+CUntxyb+DVS/UfI9EHFkEnY47Uig4jY6V8L+jt5a2lVpxcuxP/Oi710e5rmQWDu +2Q9xave8//ZqC6XBfcub7itA1nnicFw24i4MrUeR1YP7+yVJXZXhpPq5KgcVnQm3FbMXfAaBtvAn VQNTgek1SygOMHtTRdiPLm3jia6vkXNS3fw0rNZpTM66cwTZVzIL4LTcNU7zxCafWWGTq/wDAADIx 5q6UY1bxtC8GUII5eJKt8Q==; Original-Received: from [87.69.77.57] (port=3873 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 1oNvv4-0005eT-Qr; Tue, 16 Aug 2022 08:43:43 -0400 In-Reply-To: <325f95fd2bce114fd74d@heytings.org> (message from Gregory Heytings on Tue, 16 Aug 2022 12:17:10 +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:239918 Archived-At: > Date: Tue, 16 Aug 2022 12:17:10 +0000 > From: Gregory Heytings > cc: 57207@debbugs.gnu.org, yantar92@gmail.com > > > We update UNCHANGED_MODIFIED in mark_window_display_accurate_1, so if > > the window completes its redisplay cycle "normally", whatever jit-lock > > does shouldn't matter for the next redisplay cycle, because > > UNCHANGED_MODIFIED will be updated from MODIFF. > > Hmmm... The fact is that using CHARS_MODIFF avoids rescanning the buffer > when "too many" text properties are changed. With xdisp.c, the long lines > detection code is not called anymore when scrolling through the (initially > unfontified) buffer. The original bug description (additional delays > between redisplay cycles in a large buffer) is probably caused by > needlessly executing that long lines detection code, at least that's > consistent with my earlier experiments. That was also my guess. (I do see the long-line detection code sometimes called while scrolling through xdisp.c, but that's probably because my Emacs is unoptimized, and so cannot keep up with the auto-repeat rate of my keyboard when I lean on C-v; and so some redisplay cycles are interrupted prematurely and don't get to mark_window_display_accurate_1.) > > What I don't understand is why enlarging the value of the threshold > > causes Emacs to "hang". If it really is some kind of infloop, I cannot > > understand how issues like outdated UNCHANGED_MODIFIED could cause that > > only for some value of the threshold, but not for a smaller value. I > > thought perhaps there are lines longer than 10000 characters, but none > > beyond 100000, but this turns out to be false, so with both values of > > the threshold that loop in redisplay_window should have scanned the > > entire buffer top to bottom in both cases... > > > > So I suspect something else is at work here. > > > > Yes, I suspect that this is another bug, separate from the original bug > Ihor described. It might be a bug in find_newline1, in the backtrace he > sent, find_newline1 returns 10568710 and later 9679581. It's not clear > however if that's in the same loop (he asked gdb to "continue" between the > two). This part of my confusion is now off the table. So the primary suspect is something that causes UNCHANGED_MODIFIED fail to be updated.