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#56682: Fix the long lines font locking related slowdowns Date: Wed, 27 Jul 2022 20:26:49 +0300 Message-ID: <837d3ybh5z.fsf@gnu.org> References: <837d46mjen.fsf@gnu.org> <174616cd5c33bfc14b1f@heytings.org> <837d44jr4p.fsf@gnu.org> <83bktghrn0.fsf@gnu.org> <8a3eaeef010995a5da8d@heytings.org> <837d40ds09.fsf@gnu.org> <83zggwcby5.fsf@gnu.org> <83o7xccagi.fsf@gnu.org> <831qu7daxb.fsf@gnu.org> <83sfmnb7yg.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="14876"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 56682@debbugs.gnu.org, gregory@heytings.org, monnier@iro.umontreal.ca To: Gerd =?UTF-8?Q?M=C3=B6llmann?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Jul 27 19:27:17 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 1oGkoX-0003h6-Ee for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 27 Jul 2022 19:27:17 +0200 Original-Received: from localhost ([::1]:57316 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oGkoV-00012K-T3 for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 27 Jul 2022 13:27:15 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:34770) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oGkoI-00011J-0e for bug-gnu-emacs@gnu.org; Wed, 27 Jul 2022 13:27:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:38941) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oGkoH-00074M-O1 for bug-gnu-emacs@gnu.org; Wed, 27 Jul 2022 13:27:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oGkoH-0002py-Jb for bug-gnu-emacs@gnu.org; Wed, 27 Jul 2022 13:27:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 27 Jul 2022 17:27:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 56682 X-GNU-PR-Package: emacs Original-Received: via spool by 56682-submit@debbugs.gnu.org id=B56682.165894281310887 (code B ref 56682); Wed, 27 Jul 2022 17:27:01 +0000 Original-Received: (at 56682) by debbugs.gnu.org; 27 Jul 2022 17:26:53 +0000 Original-Received: from localhost ([127.0.0.1]:56923 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oGko8-0002pW-Hh for submit@debbugs.gnu.org; Wed, 27 Jul 2022 13:26:52 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:50008) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oGko4-0002pF-97 for 56682@debbugs.gnu.org; Wed, 27 Jul 2022 13:26:51 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:34606) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oGkny-000733-8w; Wed, 27 Jul 2022 13:26:42 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=v73fKQda7fq56RlLCJY7rBTTlOjGQUItXuiekcQ+7dc=; b=eJG3Xw88PzbVH2cdIqIK qATWVVFY1wj6IkUEC0EmIeT43Z44E0u8qyWZJ6Ru3+g2yHweI0POWMihc5RMqOFD1mG68WngniziD N1XlgEvD7CBCu6S/AxiMe4seDZcnuauuyV7grRydCiiS83Gbb07455dLwETy/XAuktz5wz+TGQRRa JLZy+hwe7Xz+xLHahg6VW/ukdzBuF/YKgCbks86TpvVsrebGsKpru/fj1KjjD/JNuFWxx223gkowX wCj6D1w4v3ek2fUY4COnTvmTm2ztBf9JmsKz0vqDpbOL3zruwbVA/kVscSePXbEuIVdc2U5OYKekm A1vMdax7jlTCTA==; Original-Received: from [87.69.77.57] (port=4902 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 1oGknx-000603-N9; Wed, 27 Jul 2022 13:26:42 -0400 In-Reply-To: (message from Gerd =?UTF-8?Q?M=C3=B6llmann?= on Wed, 27 Jul 2022 08:24:45 +0200) 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:238052 Archived-At: > From: Gerd Möllmann > Cc: gregory@heytings.org, 56682@debbugs.gnu.org, monnier@iro.umontreal.ca > Date: Wed, 27 Jul 2022 08:24:45 +0200 > > Eli Zaretskii writes: > > > Gerd, the search for display properties and overlays in > > forward_to_next_line_start, which disables the 'reseat' shortcut, is > > because these could have strings as values, and those strings could > > have embedded newlines, right? Or are there some other reasons? > > Correct, and I don't think there are other reasons. Thanks, I installed an optimization, which makes Isearch faster in such cases. Turning off isearch-lazy-highlight in these cases is still a good idea, though. The next problem with long-and-truncated lines is that in many places as part of redisplay we begin from the line's beginning and then go to the position of point or the first visible X coordinate or somesuch. This becomes slow when point is very far to the right, like near the end of the line. A typical place in the code where this happens is at beginning of display_line, where we call move_it_in_display_line_to to get to it->first_visible_x. This could take seconds if there are many overlays on the line, which is what happens, for example, if we are in the middle of Isearch and isearch-lazy-highlight is turned ON. (Searching for "