From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#45898: 27.1; wedged in redisplay again Date: Thu, 30 Jun 2022 13:22:29 -0400 Message-ID: References: <46b65e3f-cf3d-a3f2-9a9a-100e58274ff6@jovi.net> <83h74t3k5u.fsf@gnu.org> <87tu8sx569.fsf@gnus.org> <83v8t6us8t.fsf@gnu.org> <87zgiinptk.fsf@gnus.org> <83mteiufih.fsf@gnu.org> <877d5kojbo.fsf@gnus.org> <83zgigu3e0.fsf@gnu.org> <500e4b9c69f2a90e7cf05b956178d71b@webmail.orcon.net.nz> <835yl3tnv3.fsf@gnu.org> <83iloyo0x7.fsf@gnu.org> <83mte5jukr.fsf@gnu.org> <837d57gbed.fsf@gnu.org> <83o7yicx3p.fsf@gnu.org> <83pmir5lwc.fsf@gnu.org> <83mtdu68cl.fsf@gnu.org> Reply-To: Stefan Monnier Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="19823"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: gerd.moellmann@gmail.com, psainty@orcon.net.nz, larsi@gnus.org, Emacs-hacker2018@jovi.net, 45898@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Jun 30 19:23:15 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 1o6xsp-0004y6-6g for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 30 Jun 2022 19:23:15 +0200 Original-Received: from localhost ([::1]:57964 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o6xso-0008A1-7a for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 30 Jun 2022 13:23:14 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:53010) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o6xsc-00087o-1Z for bug-gnu-emacs@gnu.org; Thu, 30 Jun 2022 13:23:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:41635) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o6xsb-0004p3-PE for bug-gnu-emacs@gnu.org; Thu, 30 Jun 2022 13:23:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1o6xsb-0001KJ-K2 for bug-gnu-emacs@gnu.org; Thu, 30 Jun 2022 13:23:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 30 Jun 2022 17:23:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 45898 X-GNU-PR-Package: emacs Original-Received: via spool by 45898-submit@debbugs.gnu.org id=B45898.16566097635060 (code B ref 45898); Thu, 30 Jun 2022 17:23:01 +0000 Original-Received: (at 45898) by debbugs.gnu.org; 30 Jun 2022 17:22:43 +0000 Original-Received: from localhost ([127.0.0.1]:35532 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o6xsI-0001JY-KV for submit@debbugs.gnu.org; Thu, 30 Jun 2022 13:22:42 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:50721) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o6xsE-0001JF-70 for 45898@debbugs.gnu.org; Thu, 30 Jun 2022 13:22:40 -0400 Original-Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 746F3100135; Thu, 30 Jun 2022 13:22:32 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 27086100121; Thu, 30 Jun 2022 13:22:31 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1656609751; bh=ZXJZajxAYPj9AWPL/Xy8ES3m1MukRpJyRGXEpRb8vXQ=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=dtQUendV3bU4WGCjVNBUKQnj76feBM7mKOdudWC7ynbI15GOs5pjl86xjucVqUoGf bxUAej3PeiYajzWK//xDRcH0wcuXxlxoWcQBxd18XIQ1gA79wOL3JAYOrOuWvkRk02 Yy3APx05LTxVietRxmWCKixbvmSt/tz338k+y2p83me7cV4m8PBHVl3XE8pCWxZaB4 MyAEXZ2xsVQ7tqjb1uINLFCUkvF/10jdjghSsNBdrZzd0xkfnimBaZc6D1bDjE+dMQ oSFOhZY4cZLcAquzYRd7kIA3ToLpbSUP20tKVyypdZOyaNnHH2Sz3g9bm9CLMrJ7c2 shzbnwCtx5IZQ== Original-Received: from alfajor (unknown [45.44.229.252]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 98E73120180; Thu, 30 Jun 2022 13:22:30 -0400 (EDT) In-Reply-To: <83mtdu68cl.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 30 Jun 2022 08:14:34 +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:235741 Archived-At: >> and then tried to move around in the buffer, search with Isearch, and >> insert a few chars. >> I don't notice any difference with or without the patch :-( > > If you start moving with C-n or C-v, Emacs becomes unusable > approximately around the same buffer position with and without the > patch? Yup. And moving at the end of the file with C-p and M-v is also "about as bad". > If so, I guess the expensive part is somewhere else. Unsuprisingly so: none of `C-n/C-p/C-v/...` involve font-lock or jit-lock either during their operation or during the subsequent redisplay phase in the current code: the one-line is all fontified once and for all when you open the file and after that font-lock is not involved any more (until you make an edit, that is). The only operation where I can see an improvement is when editing the file near the beginning where the `master` code take a couple seconds per edit (the time to refontify the whole line/buffer) whereas with the patch it takes a fraction of a second (definitely not immediate, tho). It also does open up the file a bit faster, but it pays for it by taking more time to jump to the end: - open file: master=5s patch=3s - M-> : master=10s patch=14s [ Note: these time measurements are *very* approximate. ] So while we do get some benefit occasionally by chunking, the chunking itself slows us down. > I'd install this patch regardless, because it sounds like TRT not to > let syntactic fontifications run amok this way. We do similar stuff > in bidi.c for similar reasons. OK, I pushed it to `master`. The improvement is far from convincing, but I tend to agree that it's "The Right Thing".