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#71644: 30.0.50; Severe slowdown in larger files with markers beginning in emacs 29+ Date: Sat, 22 Jun 2024 11:09:25 -0400 Message-ID: References: Reply-To: Stefan Monnier Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="38840"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 71644@debbugs.gnu.org To: Mitchell Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Jun 22 17:10:30 2024 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 1sL2Nq-0009pc-JL for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 22 Jun 2024 17:10:30 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sL2NQ-0001ri-0v; Sat, 22 Jun 2024 11:10:04 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sL2NP-0001rX-0d for bug-gnu-emacs@gnu.org; Sat, 22 Jun 2024 11:10:03 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sL2NO-0007Ia-KP for bug-gnu-emacs@gnu.org; Sat, 22 Jun 2024 11:10:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sL2NN-0000LQ-V7 for bug-gnu-emacs@gnu.org; Sat, 22 Jun 2024 11:10: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: Sat, 22 Jun 2024 15:10:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 71644 X-GNU-PR-Package: emacs Original-Received: via spool by 71644-submit@debbugs.gnu.org id=B71644.17190689791254 (code B ref 71644); Sat, 22 Jun 2024 15:10:01 +0000 Original-Received: (at 71644) by debbugs.gnu.org; 22 Jun 2024 15:09:39 +0000 Original-Received: from localhost ([127.0.0.1]:49250 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sL2N0-0000K7-Bh for submit@debbugs.gnu.org; Sat, 22 Jun 2024 11:09:39 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:6582) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sL2My-0000Jl-3Q for 71644@debbugs.gnu.org; Sat, 22 Jun 2024 11:09:36 -0400 Original-Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 92DB044418E; Sat, 22 Jun 2024 11:09:28 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1719068966; bh=mzaljtl/ikyK/fIuitP1Hqoy+cyA7gBxNYHTf2bGS7I=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=VtYvXBvvLtxUxyB59TFqhptVJD9U+mYLz4SqmbrE2cRLSRgZoYmeG5PcfDwt/jWE4 ZPmFxNJ6/BDrPGGm1dnsmJp+R5rFMN2pu570LB8wU4eCEoOwQQnkCaPJ93/niDbO4h 0O5ApGMdQ3MW4RhIbYkk4V5iABEa+xgMeZVC4fGgYfRkfwC2+Ffrqfe3no8rCeX3hN mBmDdb7YSImONGum5QFDvnCMZeJULqpCWw6H0UaH2tGz1h2ug+nng8okO+9TmQFhou UFBcMfH31JHc1WvPkAhn/Wtc0DON4oLyzA14Qcmo7rNcAj4ZUwBjHFHeSZm5rTaBZV nzeJ8EbnlFAYw== Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id A46EA442179; Sat, 22 Jun 2024 11:09:26 -0400 (EDT) Original-Received: from pastel (unknown [24.140.236.196]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 78A8F12022C; Sat, 22 Jun 2024 11:09:26 -0400 (EDT) In-Reply-To: (Mitchell's message of "Tue, 18 Jun 2024 23:25:18 -0600") 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:287713 Archived-At: > 1. Start emacs 29.3 (or 30.0.50) with emacs -q. > 2. Paste the minimal config at > https://gist.github.com/kings2u/30b7a22dfa38fe0d5dc18adaf0e5e9de into the > scratch buffer and eval-buffer. (Note on my system I'm using the `counsel` > version current as of counsel-20240502.743, but any recent version will > reproduce the bug). I used the code below: (customize-set-variable 'large-file-warning-threshold nil) (package-install 'counsel) (package-activate 'counsel) > 7. Start typing `n` `space`, or `t` `space` several times very fast and > observe how long it takes for the abbrev expansions (defined in the minim= al > config above) to show up on the screen. Without running `counsel-outline`, the insertion is "immediate", whereas after `counsel-outline` it takes about two seconds for me. > Using emacs 29+, when I use `profiler-start` (CPU) between Steps 4 and 5, > and then `profiler-stop` after Step 7, I get a very big entry (e.g., 70%) > for `redisplay_internal (C function)` in the `profiler-report`. Using the > `profiler` at the same points using emacs 28.2, I don=E2=80=99t get a big= entry for > `redisplay_internal (C function)`. [ I haven't been able to get a meaningful profiler report yet. E.g. I get 82% of the time given to `read-from-minibuffer`, which is presumably the time spent typing `M-x profiler-report RET` or some such, even though I typed enough `n SPC` repetitions that it should dwarf that. Not sure what's going on. ] Also I notice that if I do `n` and then wait, it takes the same amount of time to see the result as if I do `n n n n` and then wait. So it seems that the command themselves execute "instantly", and the delay occurs later (jit-lock? redisplay? ...). I also notice that step 6 is important: if I just go straight to line 35 and type text, there's no delay. Other thing I noticed M-g M-g 60000 RET n n n n n M-g M-g 35 RET n n n n n there's no delays typing the `n` at line 60000 but there is a 2s delay at line 35. The fact that the absence of non-ASCII chars eliminates the problem strongly points the finger to the bytes<->chars conversion which relies on markers, indeed, but it's still very puzzling: line 35 is about 1.5kB from the beginning of the buffer, so the conversion should be simple and fast. there. IOW, if it's a slow bytes<->chars conversion it's probably a conversion taking place elsewhere than near point. AFAICT the most significant change w.r.t markers in Emacs-29 is that markers aren't used internally for overlays any more, so there are usually *fewer* markers in Emacs-29 buffers than in Emacs-28 buffers (which can be both favorable and detrimental to bytes<->chars conversion, depending on details). But in any case, (overlays-in (point-min) (point-max)) tells me there's only one overlay and even 0 in Emacs-28, so that can't be the reason for the change. Stefan "puzzled"