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: Fri, 29 Jul 2022 16:58:35 +0300 Message-ID: <83mtcs6mwk.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> <837d3ybh5z.fsf@gnu.org> <136c4fe0fc74196714aa@heytings.org> <83pmhp89ov.fsf@gnu.org> <136c4fe0fc39573addc9@heytings.org> <83k07x8738.fsf@gnu.org> <136c4fe0fcdf00ef9a11@heytings.org> <83h73183r7.fsf@gnu.org> <136c4fe0fc0fceb0d752@heytings.org> <838roc8ka7.fsf@gnu.org> <83tu706obt.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="32654"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 56682@debbugs.gnu.org, larsi@gnus.org, monnier@iro.umontreal.ca To: gregory@heytings.org, gerd.moellmann@gmail.com Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Jul 29 15:59:30 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 1oHQWY-0008IA-G0 for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 29 Jul 2022 15:59:30 +0200 Original-Received: from localhost ([::1]:38922 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oHQWX-0007dW-Fn for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 29 Jul 2022 09:59:29 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:52428) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oHQW7-0007VV-5N for bug-gnu-emacs@gnu.org; Fri, 29 Jul 2022 09:59:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:43355) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oHQW6-0007nw-LV for bug-gnu-emacs@gnu.org; Fri, 29 Jul 2022 09:59:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oHQW6-0007FC-FT for bug-gnu-emacs@gnu.org; Fri, 29 Jul 2022 09:59: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: Fri, 29 Jul 2022 13:59:02 +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.165910311127784 (code B ref 56682); Fri, 29 Jul 2022 13:59:02 +0000 Original-Received: (at 56682) by debbugs.gnu.org; 29 Jul 2022 13:58:31 +0000 Original-Received: from localhost ([127.0.0.1]:33101 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oHQVa-0007E3-SR for submit@debbugs.gnu.org; Fri, 29 Jul 2022 09:58:31 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:39336) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oHQVY-0007Dm-UF for 56682@debbugs.gnu.org; Fri, 29 Jul 2022 09:58:29 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:39928) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oHQVT-0007lB-Fn; Fri, 29 Jul 2022 09:58:23 -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=L3rLp/kk87Zd3Q3XV4q6j73hJDKCI2Ag+N2HRH8icvI=; b=D0SbkjeW7EXh ox21SFqbdCyS63vaDOlN2spbBu/PJxZl2lKmZauVSOKO44uBHXhyiOmo0RywRBgAKEK/+qcQ857fG S+GKMk6s4Fl9eUgMCkAmIagFMOTyTm0OBkn/3ARaJAw74/MrdlMTZ12N4lLm9SCINYZsKTM0vO/zv PuMWjFZixi+v+rGT+797MHt4YBxioClupAh40wOhozjTNktXKBOrOdxdCQRfPOLEmy6Lnk0yvi96p fdQGDc2P6bK9b4NOenJQcCNpuRroF5RHDaLlx4M9mD7eYXOJ9726HGh5jMrfaqnaRqNSPTEbRVyho o3Fior7yMu10Qhq79+YGxA==; Original-Received: from [87.69.77.57] (port=2225 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 1oHQVS-0005Jk-VJ; Fri, 29 Jul 2022 09:58:23 -0400 In-Reply-To: <83tu706obt.fsf@gnu.org> (message from Eli Zaretskii on Fri, 29 Jul 2022 16:27:50 +0300) 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:238179 Archived-At: > Cc: gerd.moellmann@gmail.com, 56682-done@debbugs.gnu.org, larsi@gnus.org, > monnier@iro.umontreal.ca > Date: Fri, 29 Jul 2022 16:27:50 +0300 > From: Eli Zaretskii > > Hmm... I'm bothered by this code in handle_fontified_prop: > > if (it->narrowed_begv) > Fnarrow_to_region (make_fixnum (it->narrowed_begv), > make_fixnum (it->narrowed_zv), Qt); > And another thing: the condition on it->narrowed_begv being non-zero means that as long as we are close enough to the beginning of a buffer, we don't restrict fontification-functions from going as far as they want into the buffer. So I think the condition should be the long_line_optimizations_p flag of the buffer, and we should narrow the buffer even when we are at BOB, to prevent fontification-functions from going too far.