From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= Newsgroups: gmane.emacs.bugs Subject: bug#64391: buffer narrowing slowdown regression in emacs 29 Date: Fri, 7 Jul 2023 11:30:11 +0200 Message-ID: References: <87r0psb51z.fsf@ust.hk> <0AD15A09-F669-48C0-AF5C-971D52F5BF8E@gmail.com> <83v8f3q1ff.fsf@gnu.org> <50A46AAC-2089-45CB-A355-CCB2B4EA8D76@gmail.com> <5995c9ed6a0b39c3070c@heytings.org> <83a5wak1tr.fsf@gnu.org> <26cee506f708f3c6cfe1@heytings.org> <26cee506f70bbc9de58b@heytings.org> <83h6qghpdc.fsf@gnu.org> <26cee506f77e9c87e325@heytings.org> Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.15\)) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="4644"; mail-complaints-to="usenet@ciao.gmane.io" Cc: acohen@ust.hk, 64391@debbugs.gnu.org, Eli Zaretskii , monnier@iro.umontreal.ca To: Gregory Heytings Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Jul 07 11:31:17 2023 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 1qHho4-00011L-Uj for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 07 Jul 2023 11:31:16 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qHhnu-0004XK-A8; Fri, 07 Jul 2023 05:31:06 -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 1qHhnq-0004X4-SV for bug-gnu-emacs@gnu.org; Fri, 07 Jul 2023 05:31:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qHhnq-0000D4-GW for bug-gnu-emacs@gnu.org; Fri, 07 Jul 2023 05:31:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qHhnp-0003s6-Qv; Fri, 07 Jul 2023 05:31:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org, bugs@gnus.org Resent-Date: Fri, 07 Jul 2023 09:31:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 64391 X-GNU-PR-Package: emacs,gnus Original-Received: via spool by 64391-submit@debbugs.gnu.org id=B64391.168872223114844 (code B ref 64391); Fri, 07 Jul 2023 09:31:01 +0000 Original-Received: (at 64391) by debbugs.gnu.org; 7 Jul 2023 09:30:31 +0000 Original-Received: from localhost ([127.0.0.1]:42530 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qHhnK-0003rL-Mf for submit@debbugs.gnu.org; Fri, 07 Jul 2023 05:30:31 -0400 Original-Received: from mail-lj1-f173.google.com ([209.85.208.173]:44406) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qHhn9-0003qv-D2 for 64391@debbugs.gnu.org; Fri, 07 Jul 2023 05:30:29 -0400 Original-Received: by mail-lj1-f173.google.com with SMTP id 38308e7fff4ca-2b703caf344so24419111fa.1 for <64391@debbugs.gnu.org>; Fri, 07 Jul 2023 02:30:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1688722213; x=1691314213; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:sender:from:to:cc:subject :date:message-id:reply-to; bh=5Y8jdh4DgbARQAMcKPM21wGWhUrNnK9GLrr5Au9nWx8=; b=iYXeY3uHsZ6vJgv7MMvlhGiR1eqQjbPuVMPqCmgf+S23GSfhnoeXP4/yoMqCy86UO1 sH5/GsDHcW3N2B9PUItig2aBr26MDMgl+ydFB+cHwOAEJaFOP471U0rBo5Befkf19QMB D4oxhpYFeGRePoHVkBIFyn/u/Ax1CxcF5cs+BkLenbx2xRaEzI/J+FyvjqEDR1qXo+cs 3BDAEP33rCkU/gWhyV2cEidNJBW6wwhlPIjcvOI0oBuZTA2MokovQWau9IP7dAIFZk2R OE9V58PAsi1/1Hc7IxLcZtZIOy0ZneW6v+CI7TuetfvflDJIzyJIh4xz34RiO/EW9trM f7Sg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688722213; x=1691314213; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:sender:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=5Y8jdh4DgbARQAMcKPM21wGWhUrNnK9GLrr5Au9nWx8=; b=g+sN001j1X7JGv0ky9HdrBbxrASErjaaTkRc0TjbRnlWUvju3MyaWfPuewRe0ZN+/X xtRJLc1t6awcQBYXUOnofkj/FHoRj3cZIlP85/nKYovQX9D0S8bdZoUzC5wSYpZ7/7Jd u41i09pKcJeo5f1qIMfrWtcwgCry/KdLtFCY6WzVwU00LH+hrwF9QTxPmvfrKCT8By6Y IaWhKOt9CzjxdWwZPiiayRhlBsEWdV7Z05beb7KxFNZArqFrLrswHSQRnUZtqcTqTJiR 67v+99jRqNq562ZAgGrdEDEFMPmDzlsG+7DMEYMgj+qAw5yqJ/SV0Xj0R4CV6lKnd5HY VjOA== X-Gm-Message-State: ABy/qLYgH4/p8UAKy34/dLcX8W3/21RScZJwZBhqrBr9Ixre4gbHevzG O2zM7cLMVfNmbGDQHRKNxbE= X-Google-Smtp-Source: APBJJlErkJzSBBK37bDVp129YzJ2aUJVmbB4TZAUQKSqlegsStRmRL87YNTXaL/Cej31t+YJRm+SUQ== X-Received: by 2002:a2e:9d04:0:b0:2b6:e8a0:a7f8 with SMTP id t4-20020a2e9d04000000b002b6e8a0a7f8mr3135242lji.31.1688722212987; Fri, 07 Jul 2023 02:30:12 -0700 (PDT) Original-Received: from smtpclient.apple (c188-150-165-235.bredband.tele2.se. [188.150.165.235]) by smtp.gmail.com with ESMTPSA id s21-20020a2e83d5000000b002b6d5395732sm691833ljh.1.2023.07.07.02.30.12 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 07 Jul 2023 02:30:12 -0700 (PDT) In-Reply-To: <26cee506f77e9c87e325@heytings.org> X-Mailer: Apple Mail (2.3654.120.0.1.15) 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:264710 Archived-At: 6 juli 2023 kl. 20.45 skrev Gregory Heytings : >> How are those different from what Mattias proposed? Is this a = completely different set of changes, or is it what Mattias suggested, = just in several separate parts? >>=20 >=20 > It resembles what Mattias proposed of course (remove the negative = effect of setting a buffer-local variable in all calls to = narrow-to-region, and limit it to case when labeled narrowing is used), = but it's nonetheless different. The essential change is isolated in the = first commit, and in the second commit, instead of moving the body of = Fnarrow_to_region to another function with an additional (third) = argument, I use another separate function which calls Fnarrow_to_region. = I believe the result is clearer. Gregory's first two patches and mine are indeed equivalent up to = refactoring; either would do. The moving parts are the same, so = performance shouldn't differ noticeably. Neither appears to tie our = hands for future changes as the interfaces are all internal. The third of Gregory's patches appears mainly cosmetic. Maybe that one = is less important for emacs-29. I have one question about the new `with-restriction` macro: if it is = intended as a convenience macro for unlabelled narrowing as well, = shouldn't it then expand to the obvious (save-restriction (narrow-to-region BEG END) BODY) instead the much more expensive call to a helper function? The documentation should also make it clear that `nil` is not a valid = label.