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#71644: 30.0.50; Severe slowdown in larger files with markers beginning in emacs 29+ Date: Fri, 21 Jun 2024 09:48:58 +0300 Message-ID: <86y16ylrj9.fsf@gnu.org> References: <86ed8tozub.fsf@gnu.org> <86jzijmo5a.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="2840"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 71644@debbugs.gnu.org To: Mitchell , Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Jun 21 08:50:19 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 1sKY6E-0000SG-Il for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 21 Jun 2024 08:50:18 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sKY5w-0006VU-Rf; Fri, 21 Jun 2024 02:50:01 -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 1sKY5u-0006VF-TD for bug-gnu-emacs@gnu.org; Fri, 21 Jun 2024 02:49:58 -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 1sKY5u-0002tH-Bs for bug-gnu-emacs@gnu.org; Fri, 21 Jun 2024 02:49:58 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sKY5y-0003Uu-GM for bug-gnu-emacs@gnu.org; Fri, 21 Jun 2024 02:50: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, 21 Jun 2024 06:50:02 +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.171895255613372 (code B ref 71644); Fri, 21 Jun 2024 06:50:02 +0000 Original-Received: (at 71644) by debbugs.gnu.org; 21 Jun 2024 06:49:16 +0000 Original-Received: from localhost ([127.0.0.1]:56716 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sKY5D-0003Tc-Ja for submit@debbugs.gnu.org; Fri, 21 Jun 2024 02:49:15 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:46302) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sKY5B-0003TO-U0 for 71644@debbugs.gnu.org; Fri, 21 Jun 2024 02:49:15 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sKY52-0002oj-1n; Fri, 21 Jun 2024 02:49:04 -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=Z0J8aPuHrE+3ohIFzBCUze+l9/TkY/EFX7Xi8cdRR5w=; b=DHd/MskpgbARbUXnUWzR 9BluJGLN2atV2zlCB11Rcj9vklRIl/2ghgmajBiXl1Atmaq9Qcwxl0BMC4OXiVzccymVRi7tkFT1e anBwoLk4hdV1ow74skNhbPfZsICOeeLDk5CJgifcFdkBidntv3bqmUAb0LJgNDVLT++Y/bHRGgUii vQPsKV73CONAd0b7wbIgVj/fhsqob/F068/Ve58AWdnikyX1kfjDs2B/S+vwvPj0j6o2mtZOxYnFB 9H/xI1VgMuiifsw4WEBKh0JLiEO82+JZ8In6jHnEKvNKT68KdSR3eKmYVYS70w0RuVmb+jSo62Jhu TOYxGSjlNxzWaQ==; In-Reply-To: (message from Mitchell on Thu, 20 Jun 2024 20:46:51 -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:287614 Archived-At: > From: Mitchell > Date: Thu, 20 Jun 2024 20:46:51 -0600 > Cc: 71644@debbugs.gnu.org > > > If you remove all the non-ASCII characters from the Org file, does the > > slowdown go away? > > Eli, that solved it! The new test file is at > https://gist.github.com/kings2u/2ef0e145f2b42d0a13605b0dc9b6e6e2. I replaced every non-ASCII character > with an "a" so the file still has the same number of total characters, and in my emacs 30.0 50 build (as of > 2024-05-25), doing Steps 1 to Step 7 gives me abbrev expansions that are as lighting fast as in emacs 28.2! > > So what now? Do you think you can solve what’s going on in the backend so bigger buffers with markers and > non-ASCII characters don’t exhibit this slowness in the latest emacs? The fact that the problem goes away when you remove non-ASCII characters is a pretty convincing argument in favor of your theory that markers are involved. Because Emacs consults the buffer's markers whenever it needs to convert character positions to byte positions or vice versa, which is done _a_lot_. The only significant change I see in markers code that could be related to converting character to byte positions is this: commit 8783700b23e70874c4996908bf02c010ae6f3fe1 Author: Stefan Monnier AuthorDate: Tue Aug 2 10:38:53 2022 -0400 Commit: Stefan Monnier CommitDate: Tue Aug 2 13:06:51 2022 -0400 * src/xdisp.c (redisplay_window): Use BEG rather than hard coding 1 It changed the comparison operator in two places in marker.c. Curiously, the log message doesn't even mention the change in marker.c, which could be a sign that this change was not intended to be installed. Stefan, did you intend to install it, and if so, do you have any comments about this bug report? I'm a bit confused by the fact that I don't see the slowdown on my machine, but maybe there are other factors at work here that hide the regression.