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, 22 Jul 2022 18:06:44 +0300 Message-ID: <83lesljiez.fsf@gnu.org> References: <837d46mjen.fsf@gnu.org> <174616cd5c33bfc14b1f@heytings.org> <83o7xhjj4a.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="30538"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 56682@debbugs.gnu.org To: gregory@heytings.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Jul 22 17:14:26 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 1oEuME-0007kj-Gf for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 22 Jul 2022 17:14:26 +0200 Original-Received: from localhost ([::1]:55236 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oEuMD-0006hE-7k for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 22 Jul 2022 11:14:25 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:37650) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oEuG2-0005JT-Ph for bug-gnu-emacs@gnu.org; Fri, 22 Jul 2022 11:08:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:52406) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oEuG2-00022b-Gu for bug-gnu-emacs@gnu.org; Fri, 22 Jul 2022 11:08:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oEuG2-0006oL-Ca for bug-gnu-emacs@gnu.org; Fri, 22 Jul 2022 11:08: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, 22 Jul 2022 15:08: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.165850242226062 (code B ref 56682); Fri, 22 Jul 2022 15:08:02 +0000 Original-Received: (at 56682) by debbugs.gnu.org; 22 Jul 2022 15:07:02 +0000 Original-Received: from localhost ([127.0.0.1]:42144 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oEuF3-0006mH-Ui for submit@debbugs.gnu.org; Fri, 22 Jul 2022 11:07:02 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:52590) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oEuEz-0006li-1f for 56682@debbugs.gnu.org; Fri, 22 Jul 2022 11:07:00 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:44550) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oEuEt-0001H9-4Y; Fri, 22 Jul 2022 11:06:51 -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=3kwIcrUwLJpDkfL+3pXw5PEBxNsHFq20cweFTwjvO6g=; b=kQajUglATpf1 PWFMCw60FlHW9CN+5TaDjM/pPh4op3osjBlRIuM57kSJD0LUQMz4QIpfwvFY4cm+15bsIF26t32mC 7KM5wl1axisFTUlRsRcnypXOYdn3wUMX5e2S/1hZt4JCz3kfk36TLcIEPvUZD245O+q/YpdJ4R49U dVJoDcxbxp53VOkjdOQ+WB6y7Yywzr/1y4lVcXkQR27tnDicZjQqgLk17EiO4pMaKvVRsltxdvFYS JkezRDrf4dJWY88QlWh9IBrzAlZ8xcdMvIhgIuHqP3raeChsKvg8/DgoIny3vqGFAJfX9bKwzUHKg 411xMmw96czHtnvvmQELig==; Original-Received: from [87.69.77.57] (port=1278 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 1oEuEr-0007WR-1e; Fri, 22 Jul 2022 11:06:50 -0400 In-Reply-To: <83o7xhjj4a.fsf@gnu.org> (message from Eli Zaretskii on Fri, 22 Jul 2022 17:51:33 +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:237637 Archived-At: > Cc: 56682@debbugs.gnu.org > Date: Fri, 22 Jul 2022 17:51:33 +0300 > From: Eli Zaretskii > > > Date: Fri, 22 Jul 2022 10:16:52 +0000 > > From: Gregory Heytings > > cc: Eli Zaretskii > > > > > > on my laptop, with Emacs from master from a week ago, take respectively > > 150 seconds and 40 seconds. With the improvements on master, 1 is > > instantaneous but 2 still takes about 5 seconds. Now, with the changes in > > the feature/long-lines-and-font-locking branch, both are instantaneous. > > The price of that speedup is that some portions of the buffer will be > > mis-highlighted, which is unavoidable. > > The assertion below can now be violated: > > if (it->narrowed_begv) > { > record_unwind_protect (unwind_narrowed_begv, Fpoint_min ()); > record_unwind_protect (unwind_narrowed_zv, Fpoint_max ()); > SET_BUF_BEGV (current_buffer, it->narrowed_begv); > SET_BUF_ZV (current_buffer, it->narrowed_zv); > specbind (Qinhibit_widen, Qt); > } > > val = Vfontification_functions; > specbind (Qfontification_functions, Qnil); > > eassert (it->end_charpos == ZV); <<<<<<<<<<<<<<<<< > > because of the "narrowing". (I actually saw this assertion violation > once on the branch, but I cannot reproduce it.) Sorry, it's very easy to reproduce: visit dictionary.josn, and then type C-v several times until it happens.