From unknown Tue Sep 09 21:32:56 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#63470 <63470@debbugs.gnu.org> To: bug#63470 <63470@debbugs.gnu.org> Subject: Status: [PATCH] Use faster option for running vc-hg status Reply-To: bug#63470 <63470@debbugs.gnu.org> Date: Wed, 10 Sep 2025 04:32:56 +0000 retitle 63470 [PATCH] Use faster option for running vc-hg status reassign 63470 emacs submitter 63470 Spencer Baugh severity 63470 normal tag 63470 patch thanks From debbugs-submit-bounces@debbugs.gnu.org Fri May 12 15:28:49 2023 Received: (at submit) by debbugs.gnu.org; 12 May 2023 19:28:49 +0000 Received: from localhost ([127.0.0.1]:33189 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pxYRd-0004d5-0i for submit@debbugs.gnu.org; Fri, 12 May 2023 15:28:49 -0400 Received: from lists.gnu.org ([209.51.188.17]:60636) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pxYRb-0004cx-An for submit@debbugs.gnu.org; Fri, 12 May 2023 15:28:47 -0400 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 1pxYRa-00057O-W9 for bug-gnu-emacs@gnu.org; Fri, 12 May 2023 15:28:47 -0400 Received: from mxout5.mail.janestreet.com ([64.215.233.18]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pxYRZ-00074O-CU for bug-gnu-emacs@gnu.org; Fri, 12 May 2023 15:28:46 -0400 From: Spencer Baugh To: bug-gnu-emacs@gnu.org Subject: [PATCH] Use faster option for running vc-hg status Date: Fri, 12 May 2023 15:28:43 -0400 Message-ID: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=64.215.233.18; envelope-from=sbaugh@janestreet.com; helo=mxout5.mail.janestreet.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.4 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.4 (--) --=-=-= Content-Type: text/plain Tags: patch In GNU Emacs 29.0.90 (build 1, x86_64-pc-linux-gnu, X toolkit, cairo version 1.15.12, Xaw scroll bars) of 2023-05-09 built on igm-qws-u22796a Repository revision: 65c4a24aa0fc672bbf11e0c5187c6a29931b4363 Repository branch: emacs-29 Windowing system distributor 'The X.Org Foundation', version 11.0.12011000 System Description: CentOS Linux 7 (Core) Configured using: 'configure --with-x-toolkit=lucid --with-gif=ifavailable' --=-=-= Content-Type: text/patch Content-Disposition: attachment; filename=0001-Use-faster-option-for-running-vc-hg-status.patch >From 6fe0d4485b40f67473cad97f1b57c702dbeb3f57 Mon Sep 17 00:00:00 2001 From: Spencer Baugh Date: Fri, 12 May 2023 15:28:06 -0400 Subject: [PATCH] Use faster option for running vc-hg status As the comment says, this causes us to depend on Mercurial 4.2, which was released in 2017. However, in modern Mercurial, removing the "re:" "-I" "." options provides a 10x-20x speedup (because it allows the Rust implementation of "hg status" to be used), so it's certainly worth losing this compatibility. * lisp/vc/vc-hg.el (vc-hg-dir-status-files): Use --config status.relative=1 to make paths relative --- lisp/vc/vc-hg.el | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lisp/vc/vc-hg.el b/lisp/vc/vc-hg.el index 78231a0c954..2f6e5bc5e19 100644 --- a/lisp/vc/vc-hg.el +++ b/lisp/vc/vc-hg.el @@ -1381,11 +1381,9 @@ vc-hg-dir-status-files ;; XXX: We can't pass DIR directly to 'hg status' because that ;; returns all ignored files if FILES is non-nil (bug#22481). (let ((default-directory dir)) - ;; TODO: Use "--config 'status.relative=1'" instead of "re:" - ;; when we're allowed to depend on Mercurial 4.2+ - ;; (it's a bit faster). (vc-hg-command (current-buffer) 'async files - "status" "re:" "-I" "." + "--config" "status.relative=1" + "status" (concat "-mardu" (if files "i")) "-C")) (vc-run-delayed -- 2.30.2 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Fri May 12 15:44:07 2023 Received: (at 63470) by debbugs.gnu.org; 12 May 2023 19:44:07 +0000 Received: from localhost ([127.0.0.1]:33262 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pxYgQ-000549-TH for submit@debbugs.gnu.org; Fri, 12 May 2023 15:44:07 -0400 Received: from eggs.gnu.org ([209.51.188.92]:53598) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pxYgM-00053L-BB for 63470@debbugs.gnu.org; Fri, 12 May 2023 15:44:05 -0400 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 1pxYgG-0001cs-Re; Fri, 12 May 2023 15:43:56 -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=2vrRj59/gprHu7pW6O3r5oldtA5u2AKC9Zq3NCpyrKQ=; b=HiyKN9DCBKMP QI7n+R4HJHRubFeb5Hu44M2/+0AvXE6OVpKBGTQjdSqUo4HwxrSeQBPDlL88/5qfQoLjrdpPzkIOt bcFGbSbr2a73nzN+cCWxBzQcntt1PkSlvZC+MwuZSiZ9lV/tnnCkbdD34wtU5L/s+webOWhAJ0Wui 8R2Yis+D7sePQJ53ZjA6TDKVaNHCdbiA+x8yp4S/LeI0v06MwJ7rtwdkGf8L4Xxp/DbLLMd8f3nBc kg9uKttJnlRB+n2ylyIDMZS3GJ18wTRrLu+7BIN9Gw7Rva0S2/+0vCwsNJZh7Hoc8JgCiPatI0FuB 7pqIqqzK+TqiukLmqTe5FQ==; Received: from [87.69.77.57] (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 1pxYgF-0003bQ-5m; Fri, 12 May 2023 15:43:56 -0400 Date: Fri, 12 May 2023 22:43:52 +0300 Message-Id: <83h6shbaiv.fsf@gnu.org> From: Eli Zaretskii To: Spencer Baugh In-Reply-To: (message from Spencer Baugh on Fri, 12 May 2023 15:28:43 -0400) Subject: Re: bug#63470: [PATCH] Use faster option for running vc-hg status References: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 63470 Cc: 63470@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Spencer Baugh > Date: Fri, 12 May 2023 15:28:43 -0400 > > As the comment says, this causes us to depend on Mercurial 4.2, which > was released in 2017. However, in modern Mercurial, removing the > "re:" "-I" "." options provides a 10x-20x speedup (because it allows > the Rust implementation of "hg status" to be used), so it's certainly > worth losing this compatibility. I don't understand: what will happen to users of Mercurial < 4.2? And why cannot we detect the version and dispatch on that, instead of doing this unconditionally? From debbugs-submit-bounces@debbugs.gnu.org Fri May 12 15:57:49 2023 Received: (at 63470) by debbugs.gnu.org; 12 May 2023 19:57:49 +0000 Received: from localhost ([127.0.0.1]:33412 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pxYth-0005gk-47 for submit@debbugs.gnu.org; Fri, 12 May 2023 15:57:49 -0400 Received: from mxout1.mail.janestreet.com ([38.105.200.78]:44807) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pxYte-0005gT-Ns for 63470@debbugs.gnu.org; Fri, 12 May 2023 15:57:47 -0400 From: Spencer Baugh To: Eli Zaretskii Subject: Re: bug#63470: [PATCH] Use faster option for running vc-hg status In-Reply-To: <83h6shbaiv.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 12 May 2023 22:43:52 +0300") References: <83h6shbaiv.fsf@gnu.org> Date: Fri, 12 May 2023 15:57:41 -0400 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 63470 Cc: 63470@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Eli Zaretskii writes: >> From: Spencer Baugh >> Date: Fri, 12 May 2023 15:28:43 -0400 >> >> As the comment says, this causes us to depend on Mercurial 4.2, which >> was released in 2017. However, in modern Mercurial, removing the >> "re:" "-I" "." options provides a 10x-20x speedup (because it allows >> the Rust implementation of "hg status" to be used), so it's certainly >> worth losing this compatibility. > > I don't understand: what will happen to users of Mercurial < 4.2? They will get an error message and the vc-dir buffer will fail to update. > And why cannot we detect the version and dispatch on that, instead of > doing this unconditionally? hg --version takes a quarter of a second on my machine, which itself wipes out a lot of the performance benefit. We could cache it, but it's not clear to me how to do that correctly: there could be different hg binaries in different directories, or over TRAMP, or other such things. I could add a user option to revert to the old behavior, if you want. (It would be nice if vc was available on ELPA, then maybe we could just tell users of old mercurial versions to downgrade to an old version...) From debbugs-submit-bounces@debbugs.gnu.org Fri May 12 16:06:16 2023 Received: (at 63470) by debbugs.gnu.org; 12 May 2023 20:06:16 +0000 Received: from localhost ([127.0.0.1]:33470 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pxZ1s-0005wn-4O for submit@debbugs.gnu.org; Fri, 12 May 2023 16:06:16 -0400 Received: from out4-smtp.messagingengine.com ([66.111.4.28]:34801) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pxZ1q-0005wX-Lw for 63470@debbugs.gnu.org; Fri, 12 May 2023 16:06:15 -0400 Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 9DAA55C02E1; Fri, 12 May 2023 16:06:09 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Fri, 12 May 2023 16:06:09 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm2; t= 1683921969; x=1684008369; bh=XeM7qxg6JqHcdYu8TyrSQ1opc/WVzESxegK JJyhnXrs=; b=Nh+rDizjpydAXfaC85LRpXQmesg+Vl177KmntfOAW6Xr7Tun+bH Y5dY3uOvTX4oe6ex3eEsQhwwPzc+V5Yu9d+o5LnQbUcfCe13/SpaGEqTI1laq/2o GTf51pDsUF6zbWwnt1InNjLJ+TgTorLLbenBZGeBWC2E0Hhx+ZGRhWa/8n2F4O44 2eG7ZVdJYlH1groAI6o2/JjJZrzaeyhRnlt2BG3cSpG8w+AfP4nTztOK17EfiaAI u2HhpnGDxgioSO8dXnAYxLXyubirPjIeTUYm6XPx73DH9Gxo1KC91DCIvHwziPjL 55XYXfJJCh/tAjdDkjwVahmNxecuMSgercw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t= 1683921969; x=1684008369; bh=XeM7qxg6JqHcdYu8TyrSQ1opc/WVzESxegK JJyhnXrs=; b=a4LvkKnQsGw5EVChU3ZezfrDGxrS7PNaTejeJquaNOFFwXX17Vg wmLnqOBPmkJK9hNCr9AJmgj4D+lRRwzIKN8J0WSTh2Hjal9iakJrpbjH6HJ0F7W2 e8G15j3XINGADqto+PTXNwo6SMAjCoSYbeXcILVURkWDuFGjylRzhBl1HYresv30 RFHHGdAbP9JXrGAyIjVh7DXGXDqeYwqgneytjI6+nmgKBdZ+Ux+uyyDnxEo6YcbM BsL1SPgjjvs/pYGOz+bc7puL6FaTKDMjuzByjnurxvr+0LxB7prMTaiqO84mbO5u jJjreIWCfJrXg8YYqqmPUF6YpGXCnVEk6FA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrfeehtddgudeghecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefkffggfgfuvfevfhfhjggtgfesthejredttdefjeenucfhrhhomhepffhm ihhtrhihucfiuhhtohhvuceoughmihhtrhihsehguhhtohhvrdguvghvqeenucggtffrrg htthgvrhhnpeeigfetveehveevffehledtueekieeikeeufeegudfgfeeghfdulefgfeev ledvveenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpe gumhhithhrhiesghhuthhovhdruggvvh X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 12 May 2023 16:06:08 -0400 (EDT) Message-ID: <18946686-627e-9a5e-8551-40568c3b5733@gutov.dev> Date: Fri, 12 May 2023 23:06:06 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 Subject: Re: bug#63470: [PATCH] Use faster option for running vc-hg status Content-Language: en-US To: Eli Zaretskii , Spencer Baugh References: <83h6shbaiv.fsf@gnu.org> From: Dmitry Gutov In-Reply-To: <83h6shbaiv.fsf@gnu.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -1.8 (-) X-Debbugs-Envelope-To: 63470 Cc: 63470@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.8 (--) On 12/05/2023 22:43, Eli Zaretskii wrote: >> From: Spencer Baugh >> Date: Fri, 12 May 2023 15:28:43 -0400 >> >> As the comment says, this causes us to depend on Mercurial 4.2, which >> was released in 2017. However, in modern Mercurial, removing the >> "re:" "-I" "." options provides a 10x-20x speedup (because it allows >> the Rust implementation of "hg status" to be used), so it's certainly >> worth losing this compatibility. > I don't understand: what will happen to users of Mercurial < 4.2? How much longer do we need to support CentOS 7? Anything newer has Mercurial 4.8+. And Mercurial's latest is 6.4.3. From debbugs-submit-bounces@debbugs.gnu.org Fri May 12 16:10:19 2023 Received: (at 63470) by debbugs.gnu.org; 12 May 2023 20:10:19 +0000 Received: from localhost ([127.0.0.1]:33498 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pxZ5n-00063X-0D for submit@debbugs.gnu.org; Fri, 12 May 2023 16:10:19 -0400 Received: from out4-smtp.messagingengine.com ([66.111.4.28]:42699) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pxZ5h-000634-J0 for 63470@debbugs.gnu.org; Fri, 12 May 2023 16:10:17 -0400 Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 856EF5C02E4; Fri, 12 May 2023 16:10:08 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Fri, 12 May 2023 16:10:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm2; t= 1683922208; x=1684008608; bh=HyAfsZzl477Bj1RMUEqOcSI44RsFwaM+/YM zsRIttAM=; b=JbDhln8Y5X8EtLdUCxCpnwrriL5l3Lj9FvMUolgUmfO6ZLKfoL1 wwClX6EKM96JKd4HYnSxJOdossPXYOKUyZ/Fy8ip/reyUdSTJ1VN5wo2R7fE3LyN F+xdZelDP0+H8hMWjraMFsJVM7fV1J+KORtQoyG/FgGEIEz+9q9THF1D2xvsQqs6 Fqk43cry8OjpMg1EpEC5zic9w8+L/M6rmBoFgVuebtYBHPG909mSbVlXawZfzMnj dGAchT0kt+XI51Z2pEl0lnwOyuruunHocF9Hvt36sgct+OXIZBOi+dN5HLpkorA9 soc195vouSwZILGrDt13QO4mMoHrw5vCLiQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t= 1683922208; x=1684008608; bh=HyAfsZzl477Bj1RMUEqOcSI44RsFwaM+/YM zsRIttAM=; b=ry5FHzQ7//kXNBl5DePA9VMBsnGYLEt8PI9LK/ApQ41X83pHbo1 EsGv3Eet1m7f2IGqBx1uWjP/GdPPzDgJjr7rE8cDcpvtSBSJwbZ5SazLoWc6vNLh 7tntAQ5t2sSF9Pyx8CNkcajji1Cn8pcwMQ543v86ZzibtPuLBTJ5RgpRbaqcD0oK CCRdzR+0veMqDZTEFrwVmJK95EpWC3OeSZG5DopnExxEvqk+bcbjlBmf7HXaTbMn jxyn/ZikhORIlB9GDQX8Zk6MGuSZzIul1PO2TuAXjs0aAXXaeh7qtsaHkmIdocHX R/y66d26rPosGIX2ZCzOU7M7ie6YfQm9oAw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrfeehtddgudeghecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefkffggfgfuvfevfhfhjggtgfesthejredttdefjeenucfhrhhomhepffhm ihhtrhihucfiuhhtohhvuceoughmihhtrhihsehguhhtohhvrdguvghvqeenucggtffrrg htthgvrhhnpeeigfetveehveevffehledtueekieeikeeufeegudfgfeeghfdulefgfeev ledvveenucevlhhushhtvghrufhiiigvpedunecurfgrrhgrmhepmhgrihhlfhhrohhmpe gumhhithhrhiesghhuthhovhdruggvvh X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 12 May 2023 16:10:07 -0400 (EDT) Message-ID: Date: Fri, 12 May 2023 23:10:05 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 Subject: Re: bug#63470: [PATCH] Use faster option for running vc-hg status Content-Language: en-US To: Spencer Baugh , Eli Zaretskii References: <83h6shbaiv.fsf@gnu.org> From: Dmitry Gutov In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -1.8 (-) X-Debbugs-Envelope-To: 63470 Cc: 63470@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.8 (--) On 12/05/2023 22:57, Spencer Baugh wrote: >> And why cannot we detect the version and dispatch on that, instead of >> doing this unconditionally? > hg --version takes a quarter of a second on my machine, which itself > wipes out a lot of the performance benefit. We could cache it, but it's > not clear to me how to do that correctly: there could be different hg > binaries in different directories, or over TRAMP, or other such things. > > I could add a user option to revert to the old behavior, if you want. We could cache it like we do with vc-git--program-version. That's a simple memoization that doesn't take the host into account (though that could be implemented, too). But it'd really make things easier if we're just allowed to rely on some new enough versions of Git and Hg. > (It would be nice if vc was available on ELPA, then maybe we could just > tell users of old mercurial versions to downgrade to an old version...) I don't think so: "ELPA core" packages come from the master branch. Emacs 30 will come from it too. The only downgrade that will be available to the users of Emacs 30 is to revert to what they have bundled. And as soon as we make that change on master, that code will be gone. From debbugs-submit-bounces@debbugs.gnu.org Sat May 13 01:51:36 2023 Received: (at 63470) by debbugs.gnu.org; 13 May 2023 05:51:37 +0000 Received: from localhost ([127.0.0.1]:35409 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pxiAK-00009b-FI for submit@debbugs.gnu.org; Sat, 13 May 2023 01:51:36 -0400 Received: from eggs.gnu.org ([209.51.188.92]:49530) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pxiAG-00009J-8u for 63470@debbugs.gnu.org; Sat, 13 May 2023 01:51:34 -0400 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 1pxiAA-0002ma-Nd; Sat, 13 May 2023 01:51:26 -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=Jq0t0C14yVvCzwhWWmHZLC2A0QuS7Z3HiXFAB2HSTwU=; b=itKasRhqRHnt 5SgN018g09DVK4hQA9xXtIlLqM8Aqbhf1qyz6vJziXrP+JtBl0sReRMlzOSr1WpH12eO69M0B8PB2 JJIiwxFR+I4OvHzKhL7Npkp2tSSskZrz9PIamVqzJXdVbc37rxDxicQmE8u3wjqLKLNGd74y7oZXm aCP14DR4SqPu8T1UZoThTzTjzA5FZF2JZzuCUz59UKtQkh0DzeG91jvKO8naqcmD8ZNhedYgvot7J 4Ydp3TECTAnQYQg76F9mzPD0xkqgLuNI8KEjS3RNiOty/RNrJAXjyP9CYtARmZwtk6rafhsRy/cbu DaBhUhJlpxpz20Mr/tMZ7g==; Received: from [87.69.77.57] (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 1pxiAA-0008PT-As; Sat, 13 May 2023 01:51:26 -0400 Date: Sat, 13 May 2023 08:51:24 +0300 Message-Id: <83fs80bwyr.fsf@gnu.org> From: Eli Zaretskii To: Spencer Baugh In-Reply-To: (message from Spencer Baugh on Fri, 12 May 2023 15:57:41 -0400) Subject: Re: bug#63470: [PATCH] Use faster option for running vc-hg status References: <83h6shbaiv.fsf@gnu.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 63470 Cc: 63470@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Spencer Baugh > Cc: 63470@debbugs.gnu.org > Date: Fri, 12 May 2023 15:57:41 -0400 > > Eli Zaretskii writes: > > I don't understand: what will happen to users of Mercurial < 4.2? > > They will get an error message and the vc-dir buffer will fail to > update. That's unacceptable, sorry. There are better solutions than just stop supporting those users, so this is too harsh. > > And why cannot we detect the version and dispatch on that, instead of > > doing this unconditionally? > > hg --version takes a quarter of a second on my machine, which itself > wipes out a lot of the performance benefit. We could cache it, but it's > not clear to me how to do that correctly: there could be different hg > binaries in different directories, or over TRAMP, or other such things. There's no reason to assume there's more than one Mercurial installation on PATH. We could allow reinitialization of the version, but that would be holier that Pope, IMO. We don't do that with Git, AFAIR. > I could add a user option to revert to the old behavior, if you want. The result of the version test could set the value of the defacustom, but if we add such a defcustom, its default value should be to probe the system, not to assume version 4.2 or later. > (It would be nice if vc was available on ELPA, then maybe we could just > tell users of old mercurial versions to downgrade to an old version...) Does package.el support downgrading of packages, let alone of built-in packages? From debbugs-submit-bounces@debbugs.gnu.org Sat May 13 01:52:25 2023 Received: (at 63470) by debbugs.gnu.org; 13 May 2023 05:52:25 +0000 Received: from localhost ([127.0.0.1]:35414 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pxiB6-0000B0-W7 for submit@debbugs.gnu.org; Sat, 13 May 2023 01:52:25 -0400 Received: from eggs.gnu.org ([209.51.188.92]:38072) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pxiB4-0000An-KA for 63470@debbugs.gnu.org; Sat, 13 May 2023 01:52:23 -0400 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 1pxiAx-0002ux-Oc; Sat, 13 May 2023 01:52:17 -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=b/XAIHdeE4EyvwXAttu38yzmAsM8JSjuIwPRbtZn4sY=; b=GQw1BYHdR7uQ 070Ig6dYhgzzejqrDjwku5tsUONETZExxbYzNT6oYtp9r2aSdkmdsLYCvWBi0Bx+HcrB8QhlO3XMK fzAZ4cbg0lkPJPZTlS+psnr7mt/JDQ2NCgJNQA9EUe4pGvLmxlJuKq1qShNWD8lxfP0oTaFhcnzoP YKy5AWt7w2L+vLTEerjzyuOiNpebJHQ6KVwcckCgu65B6Cw1GwxM6VGAzR2rRKedH8serr6pTr4U2 P5IWy2SLRWBYow9c4JZje805cv8yM5aMm+ogP4F+rMO5I+V/+Mzc+PmEEll7Hr7BOYViSpN01/++y W4TYz8doxqTbMObZJukATA==; Received: from [87.69.77.57] (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 1pxiAw-0008Rn-J5; Sat, 13 May 2023 01:52:14 -0400 Date: Sat, 13 May 2023 08:52:14 +0300 Message-Id: <83ednkbwxd.fsf@gnu.org> From: Eli Zaretskii To: Dmitry Gutov In-Reply-To: <18946686-627e-9a5e-8551-40568c3b5733@gutov.dev> (message from Dmitry Gutov on Fri, 12 May 2023 23:06:06 +0300) Subject: Re: bug#63470: [PATCH] Use faster option for running vc-hg status References: <83h6shbaiv.fsf@gnu.org> <18946686-627e-9a5e-8551-40568c3b5733@gutov.dev> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 63470 Cc: sbaugh@janestreet.com, 63470@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Date: Fri, 12 May 2023 23:06:06 +0300 > Cc: 63470@debbugs.gnu.org > From: Dmitry Gutov > > On 12/05/2023 22:43, Eli Zaretskii wrote: > >> From: Spencer Baugh > >> Date: Fri, 12 May 2023 15:28:43 -0400 > >> > >> As the comment says, this causes us to depend on Mercurial 4.2, which > >> was released in 2017. However, in modern Mercurial, removing the > >> "re:" "-I" "." options provides a 10x-20x speedup (because it allows > >> the Rust implementation of "hg status" to be used), so it's certainly > >> worth losing this compatibility. > > I don't understand: what will happen to users of Mercurial < 4.2? > > How much longer do we need to support CentOS 7? As long as it's feasible, i.e. doesn't cause us to jump through too many hoops. From debbugs-submit-bounces@debbugs.gnu.org Sat May 13 01:55:05 2023 Received: (at 63470) by debbugs.gnu.org; 13 May 2023 05:55:05 +0000 Received: from localhost ([127.0.0.1]:35434 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pxiDg-0000I1-SM for submit@debbugs.gnu.org; Sat, 13 May 2023 01:55:05 -0400 Received: from eggs.gnu.org ([209.51.188.92]:53520) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pxiDf-0000Gz-Mg for 63470@debbugs.gnu.org; Sat, 13 May 2023 01:55:04 -0400 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 1pxiDa-000387-Ck; Sat, 13 May 2023 01:54:58 -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=BjmSK8v7gr81qai7tMvfKVWPUWsHLHoEi2rxrVignX8=; b=Tjx96PPOZ5RV PfyLGE50B52mik9I3aeUIhnCOCO+jfjKLZGd7/lWF8YbyvMLV2CYOEY+swe6H2wK83MgjHebk85Ox FJ9Q1xRORcsgP3L/SKtWisi1PW1JCCX/pVhXR2TjQKDaoRFREzr2TV4JUlDGYwsKDOnP2hZepaxl4 c4i2/+Zc3M2mAoDz3W6wKcjRq+36keaTLIXgJIZWCePuMKxfLc5QWjrzPC97HErs7/bAAD7SlDiGx lnz9QP30u+A0Mw/KYIMjHuEore+kM9lxnRBX3niaFxhw4ncpcJUO2RaBkEj+Nc/b/LU5cliI5xz89 emD94j753Is/SfS92YAM/A==; Received: from [87.69.77.57] (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 1pxiDZ-0000CJ-Rt; Sat, 13 May 2023 01:54:58 -0400 Date: Sat, 13 May 2023 08:54:57 +0300 Message-Id: <83bkiobwsu.fsf@gnu.org> From: Eli Zaretskii To: Dmitry Gutov In-Reply-To: (message from Dmitry Gutov on Fri, 12 May 2023 23:10:05 +0300) Subject: Re: bug#63470: [PATCH] Use faster option for running vc-hg status References: <83h6shbaiv.fsf@gnu.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 63470 Cc: sbaugh@janestreet.com, 63470@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Date: Fri, 12 May 2023 23:10:05 +0300 > Cc: 63470@debbugs.gnu.org > From: Dmitry Gutov > > On 12/05/2023 22:57, Spencer Baugh wrote: > > > > I could add a user option to revert to the old behavior, if you want. > > We could cache it like we do with vc-git--program-version. That's a > simple memoization that doesn't take the host into account (though that > could be implemented, too). Yes, that'd be a good-enough solution. > But it'd really make things easier if we're just allowed to rely on some > new enough versions of Git and Hg. It isn't easy to be backward-compatible, but we should strive at doing that. From debbugs-submit-bounces@debbugs.gnu.org Tue May 16 16:39:56 2023 Received: (at 63470) by debbugs.gnu.org; 16 May 2023 20:39:56 +0000 Received: from localhost ([127.0.0.1]:48174 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pz1Se-0007rZ-5f for submit@debbugs.gnu.org; Tue, 16 May 2023 16:39:56 -0400 Received: from mxout5.mail.janestreet.com ([64.215.233.18]:54357) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pz1Sc-0007rH-Lx for 63470@debbugs.gnu.org; Tue, 16 May 2023 16:39:55 -0400 From: Spencer Baugh To: Eli Zaretskii Subject: Re: bug#63470: [PATCH] Use faster option for running vc-hg status In-Reply-To: <83bkiobwsu.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 13 May 2023 08:54:57 +0300") References: <83h6shbaiv.fsf@gnu.org> <83bkiobwsu.fsf@gnu.org> Date: Tue, 16 May 2023 16:39:49 -0400 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 63470 Cc: Dmitry Gutov , 63470@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain Eli Zaretskii writes: >> Date: Fri, 12 May 2023 23:10:05 +0300 >> Cc: 63470@debbugs.gnu.org >> From: Dmitry Gutov >> >> On 12/05/2023 22:57, Spencer Baugh wrote: >> > >> > I could add a user option to revert to the old behavior, if you want. >> >> We could cache it like we do with vc-git--program-version. That's a >> simple memoization that doesn't take the host into account (though that >> could be implemented, too). > > Yes, that'd be a good-enough solution. > >> But it'd really make things easier if we're just allowed to rely on some >> new enough versions of Git and Hg. > > It isn't easy to be backward-compatible, but we should strive at doing > that. OK, revised backwards-compatible patch attached. --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-Use-faster-option-for-running-vc-hg-status-Bug-63470.patch >From 69d4a14dc37759ebc20196be00f0b1a6a139e6fd Mon Sep 17 00:00:00 2001 From: Spencer Baugh Date: Fri, 12 May 2023 15:28:06 -0400 Subject: [PATCH] Use faster option for running vc-hg status (Bug#63470) In modern Mercurial, removing the "re:" "-I" "." options provides a 10x-20x speedup because it allows the Rust implementation of "hg status" to be used. * lisp/vc/vc-hg.el (vc-hg--program-version): Add. (vc-hg-dir-status-files): Use --config status.relative=1 to make paths relative when available. --- lisp/vc/vc-hg.el | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/lisp/vc/vc-hg.el b/lisp/vc/vc-hg.el index 78231a0c954..bc7787d8c6c 100644 --- a/lisp/vc/vc-hg.el +++ b/lisp/vc/vc-hg.el @@ -1377,17 +1377,28 @@ vc-hg-after-dir-status ;; Follows vc-exec-after. (declare-function vc-set-async-update "vc-dispatcher" (process-buffer)) +(defvar vc-hg--program-version nil) + +(defun vc-hg--program-version () + (or vc-hg--program-version + (setq vc-hg--program-version + (with-temp-buffer + (condition-case _ (vc-hg-command t 0 nil "version") + (error "0") + (:success + (goto-char (point-min)) + (re-search-forward "Mercurial Distributed SCM (version \\([0-9][0-9.]+\\)") + (string-trim-right (match-string 1) "\\."))))))) + (defun vc-hg-dir-status-files (dir files update-function) ;; XXX: We can't pass DIR directly to 'hg status' because that ;; returns all ignored files if FILES is non-nil (bug#22481). (let ((default-directory dir)) - ;; TODO: Use "--config 'status.relative=1'" instead of "re:" - ;; when we're allowed to depend on Mercurial 4.2+ - ;; (it's a bit faster). - (vc-hg-command (current-buffer) 'async files - "status" "re:" "-I" "." - (concat "-mardu" (if files "i")) - "-C")) + (apply #'vc-hg-command (current-buffer) 'async files + "status" (concat "-mardu" (if files "i")) "-C" + (if (version<= "4.2" (vc-hg--program-version)) + '("--config" "status.relative=1") + '("re:" "-I" ".")))) (vc-run-delayed (vc-hg-after-dir-status update-function))) -- 2.30.2 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Wed May 17 07:39:46 2023 Received: (at 63470) by debbugs.gnu.org; 17 May 2023 11:39:46 +0000 Received: from localhost ([127.0.0.1]:49158 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pzFVR-0003E9-TT for submit@debbugs.gnu.org; Wed, 17 May 2023 07:39:46 -0400 Received: from eggs.gnu.org ([209.51.188.92]:43834) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pzFVQ-0003Dw-7H for 63470@debbugs.gnu.org; Wed, 17 May 2023 07:39:44 -0400 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 1pzFVJ-0005yt-GT; Wed, 17 May 2023 07:39:38 -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=u9rh26s4MLj59e5ZMK0TzZBRmsVlnfGY5b0g4pwEQl8=; b=qfeS2kSyhHRB yTt4c+zYHYapt8jBswiWV2W5PATQHA3u50EW5CG8jbiEiiyEsBZ5DuzfMLuoNqBauIIuU9Sp4u45B 6hHft3YTQaEJT9OTwtou8zVjSm14KDbZ/7d4usQs0RG6OSgbOzL78xaZ+pXWTbSi875Oi7x23ry/Z 6gn2ovdThLQXFye4KgLnM7cSG8XCSPevi6OGe9aT3d7UiaADvPIgDJ1/vLJ4THcnGP8iHx4pKx93N GqoJEwST/uh4moQKJLmdYbX23DaYTCaFfZ+2A4TuQ5+pqelJaxq283sKaVVeZJhqT8XzxPDhMqK5n 6EJ+sPLbRm9kC4qDysjQMg==; Received: from [87.69.77.57] (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 1pzFVG-0001DE-V6; Wed, 17 May 2023 07:39:36 -0400 Date: Wed, 17 May 2023 14:39:45 +0300 Message-Id: <83o7mjxk3i.fsf@gnu.org> From: Eli Zaretskii To: Spencer Baugh In-Reply-To: (message from Spencer Baugh on Tue, 16 May 2023 16:39:49 -0400) Subject: Re: bug#63470: [PATCH] Use faster option for running vc-hg status References: <83h6shbaiv.fsf@gnu.org> <83bkiobwsu.fsf@gnu.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 63470 Cc: dmitry@gutov.dev, 63470@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Spencer Baugh > Cc: Dmitry Gutov , 63470@debbugs.gnu.org > Date: Tue, 16 May 2023 16:39:49 -0400 > > Eli Zaretskii writes: > > >> Date: Fri, 12 May 2023 23:10:05 +0300 > >> Cc: 63470@debbugs.gnu.org > >> From: Dmitry Gutov > >> > >> On 12/05/2023 22:57, Spencer Baugh wrote: > >> > > >> > I could add a user option to revert to the old behavior, if you want. > >> > >> We could cache it like we do with vc-git--program-version. That's a > >> simple memoization that doesn't take the host into account (though that > >> could be implemented, too). > > > > Yes, that'd be a good-enough solution. > > > >> But it'd really make things easier if we're just allowed to rely on some > >> new enough versions of Git and Hg. > > > > It isn't easy to be backward-compatible, but we should strive at doing > > that. > > OK, revised backwards-compatible patch attached. Thanks, but I'd prefer to call the new function only once, and record the result in some variable. We do such things in umpteen other places, so it looks strange to test the version each time only in this case. If you are afraid that somehow the version could change while the Emacs session runs, we could add a command to recompute the version. I think it's reasonable to ask the user to do this by hand, since installing a new version of Mercurial should be something users are aware of. From debbugs-submit-bounces@debbugs.gnu.org Wed May 17 07:47:28 2023 Received: (at 63470) by debbugs.gnu.org; 17 May 2023 11:47:28 +0000 Received: from localhost ([127.0.0.1]:49173 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pzFcu-0003R5-3p for submit@debbugs.gnu.org; Wed, 17 May 2023 07:47:28 -0400 Received: from mxout5.mail.janestreet.com ([64.215.233.18]:55611) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pzFcr-0003Qr-S5 for 63470@debbugs.gnu.org; Wed, 17 May 2023 07:47:26 -0400 Received: from mail-yw1-f199.google.com ([209.85.128.199]) by mxgoog2.mail.janestreet.com with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) (Exim 4.96) id 1pzFcl-009L81-1j for 63470@debbugs.gnu.org; Wed, 17 May 2023 07:47:20 -0400 Received: by mail-yw1-f199.google.com with SMTP id 00721157ae682-5617e3442cbso8785967b3.0 for <63470@debbugs.gnu.org>; Wed, 17 May 2023 04:47:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=janestreet.com; s=google; t=1684324040; x=1686916040; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=rwql9Hyr1B0M4i1fb0s15qqjgr8qIzcL1y0ZdrWTKGw=; b=Tb7ntbPZRNCC1/JTrSLaQHEjfnGrw7pUtflJQLd7/yH2l3rTquNlu2qM7wBBDutnZb VXMjtDrAsw2LUUCLiDDfOisQcPxsd0E7QcBG6++8AA8DffR1q0sXSYiSxW7lDctXkMJA dPqJplX0zPIM7HD3s6TnTh5Nx5yRxFxBr1Bpo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684324040; x=1686916040; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=rwql9Hyr1B0M4i1fb0s15qqjgr8qIzcL1y0ZdrWTKGw=; b=QwMEIN+CqFUzAiP0rGeZpuuxIGXzUt8OmkhvNQgDbzox91MF9LvUhg27j/GcLSZaOX pTYC/QkzXvjH69ibDiZziYV0Sa3I1dbih7OfSulA21iwgU0twndr2xBHVKZ2cGn/MFIt 9Vifn+Xj/AAlA3sLS2xK8o4h9t+3eVDuD8PMrsepORHwh+fKJUOwAqKfRiFBriYM+j+E INQk4IosTWEVI2AmI2k4yK1KJCcGMDMPX11Y8GGPW8FyBfCpWaNZqHZyV2PMFJ4gGRbc OhKQfKinxQLqpdeFzkskuePAdWE5D83TodqOX1aRI8RiKB5rUsxQ+VjacAhmcekgYNlV mJRg== X-Gm-Message-State: AC+VfDwM3m5n3dVK7Ekh0Z5ZbB+BuVLxOx9RmM1sySbdbqFSumQhQT1y En/+TOCG/SgJk/Y/Wf8a2aLk0/feqq7JtLtrzd74xMEBfvHlUt55FAfXw4l3S13AMGCdjrPwJsY BGThSDYgrh7npIR0CjYaFM2UN7vMp5A== X-Received: by 2002:a81:5456:0:b0:55a:5ce4:aff2 with SMTP id i83-20020a815456000000b0055a5ce4aff2mr37130285ywb.39.1684324040350; Wed, 17 May 2023 04:47:20 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6w3rljo61TGCGB1cPg4w0G8qwwIv3Vl9pAXYHBX3yEvPLcsH3rHLOafV7/hPc1pP+1yN+Qr+uLLCdCO0D1szM= X-Received: by 2002:a81:5456:0:b0:55a:5ce4:aff2 with SMTP id i83-20020a815456000000b0055a5ce4aff2mr37130272ywb.39.1684324040125; Wed, 17 May 2023 04:47:20 -0700 (PDT) MIME-Version: 1.0 References: <83h6shbaiv.fsf@gnu.org> <83bkiobwsu.fsf@gnu.org> <83o7mjxk3i.fsf@gnu.org> In-Reply-To: <83o7mjxk3i.fsf@gnu.org> From: Spencer Baugh Date: Wed, 17 May 2023 07:47:09 -0400 Message-ID: Subject: Re: bug#63470: [PATCH] Use faster option for running vc-hg status To: Eli Zaretskii Content-Type: multipart/alternative; boundary="000000000000194be605fbe2402d" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 63470 Cc: Dmitry Gutov , 63470@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --000000000000194be605fbe2402d Content-Type: text/plain; charset="UTF-8" On Wed, May 17, 2023, 07:39 Eli Zaretskii wrote: > > From: Spencer Baugh > > Cc: Dmitry Gutov , 63470@debbugs.gnu.org > > Date: Tue, 16 May 2023 16:39:49 -0400 > > > > Eli Zaretskii writes: > > > > >> Date: Fri, 12 May 2023 23:10:05 +0300 > > >> Cc: 63470@debbugs.gnu.org > > >> From: Dmitry Gutov > > >> > > >> On 12/05/2023 22:57, Spencer Baugh wrote: > > >> > > > >> > I could add a user option to revert to the old behavior, if you > want. > > >> > > >> We could cache it like we do with vc-git--program-version. That's a > > >> simple memoization that doesn't take the host into account (though > that > > >> could be implemented, too). > > > > > > Yes, that'd be a good-enough solution. > > > > > >> But it'd really make things easier if we're just allowed to rely on > some > > >> new enough versions of Git and Hg. > > > > > > It isn't easy to be backward-compatible, but we should strive at doing > > > that. > > > > OK, revised backwards-compatible patch attached. > > Thanks, but I'd prefer to call the new function only once, and record > the result in some variable. We do such things in umpteen other > places, so it looks strange to test the version each time only in this > case. > Isn't that what I'm doing? I record the version in a variable and only compute it once. Also, the way I'm doing it exactly matches how vc-git does it. Do you mean a variable that controls whether to use the new argument method? Should the result be computed at load time or at first use of the variable? > > If you are afraid that somehow the version could change while the > Emacs session runs, we could add a command to recompute the version. > I think it's reasonable to ask the user to do this by hand, since > installing a new version of Mercurial should be something users are > aware of. > --000000000000194be605fbe2402d Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Wed, May 17, 2023, 07:39 Eli Zaretskii <eliz@gnu.org> wrote:
> From: Spencer Baugh <sbaugh@janestreet.com>
> Cc: Dmitry Gutov <dmitry@gutov.dev>,=C2=A0 63470@debbugs.gn= u.org
> Date: Tue, 16 May 2023 16:39:49 -0400
>
> Eli Zaretskii <eliz@gnu.org> writes:
>
> >> Date: Fri, 12 May 2023 23:10:05 +0300
> >> Cc: 63470@debbugs.gnu.org
> >> From: Dmitry Gutov <dmitry@gutov.dev>
> >>
> >> On 12/05/2023 22:57, Spencer Baugh wrote:
> >> >
> >> > I could add a user option to revert to the old behavior,= if you want.
> >>
> >> We could cache it like we do with vc-git--program-version. Th= at's a
> >> simple memoization that doesn't take the host into accoun= t (though that
> >> could be implemented, too).
> >
> > Yes, that'd be a good-enough solution.
> >
> >> But it'd really make things easier if we're just allo= wed to rely on some
> >> new enough versions of Git and Hg.
> >
> > It isn't easy to be backward-compatible, but we should strive= at doing
> > that.
>
> OK, revised backwards-compatible patch attached.

Thanks, but I'd prefer to call the new function only once, and record the result in some variable.=C2=A0 We do such things in umpteen other
places, so it looks strange to test the version each time only in this
case.

Isn't that what I'm doing? I record the version in a variable = and only compute it once.

Also, the way I'm doing it exactly matches how vc-git does it.
<= div dir=3D"auto">
Do you mean a variable that co= ntrols whether to use the new argument method? Should the result be compute= d at load time or at first use of the variable?

If you are afraid that somehow the version could change while the
Emacs session runs, we could add a command to recompute the version.
I think it's reasonable to ask the user to do this by hand, since
installing a new version of Mercurial should be something users are
aware of.
--000000000000194be605fbe2402d-- From debbugs-submit-bounces@debbugs.gnu.org Wed May 17 07:55:55 2023 Received: (at 63470) by debbugs.gnu.org; 17 May 2023 11:55:55 +0000 Received: from localhost ([127.0.0.1]:49182 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pzFl5-0003qZ-GZ for submit@debbugs.gnu.org; Wed, 17 May 2023 07:55:55 -0400 Received: from eggs.gnu.org ([209.51.188.92]:39688) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pzFl3-0003pp-Ig for 63470@debbugs.gnu.org; Wed, 17 May 2023 07:55:54 -0400 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 1pzFky-000131-1X; Wed, 17 May 2023 07:55:48 -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=DaZ9OX0XhwujPJSn00tS81nf5fv8TujQYPbPk3Nn+0U=; b=ro6C2LCyaC0p xnNrU6nBeQIKqMH2c9xHDThF29S+uaqHDap8u1jGmyLHhwvtMqWamJyVh8pVDCMJdMiKDlWaJpeJW e8dHS7lnTFKuH+7k2CEWjnEYCrPqeqpAEAuAYZPjg439V7fx75GNVOCV52E9t3gG/v4New89fVQ9e TO34czOhxIzYMLGLVOlDMYtR3ra/uFjpzaVwMtQrTX98wLR3Zcv/wzpTvrFbbOQhPw9M2D9Kpf3UZ T/EzBsWC/CdcaJKa+HEqoML85gmfvC6WH3hmgPr/zV+hQ/L3rTyA6lo50nLEbhOUGImVPDmBZ7eqF eIqQvX51nAyJYcmVt/YQ4g==; Received: from [87.69.77.57] (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 1pzFkx-0004ov-GW; Wed, 17 May 2023 07:55:47 -0400 Date: Wed, 17 May 2023 14:55:57 +0300 Message-Id: <83ilcrxjci.fsf@gnu.org> From: Eli Zaretskii To: Spencer Baugh In-Reply-To: (message from Spencer Baugh on Wed, 17 May 2023 07:47:09 -0400) Subject: Re: bug#63470: [PATCH] Use faster option for running vc-hg status References: <83h6shbaiv.fsf@gnu.org> <83bkiobwsu.fsf@gnu.org> <83o7mjxk3i.fsf@gnu.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 63470 Cc: dmitry@gutov.dev, 63470@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Spencer Baugh > Date: Wed, 17 May 2023 07:47:09 -0400 > Cc: Dmitry Gutov , 63470@debbugs.gnu.org > > Thanks, but I'd prefer to call the new function only once, and record > the result in some variable. We do such things in umpteen other > places, so it looks strange to test the version each time only in this > case. > > Isn't that what I'm doing? I record the version in a variable and only compute it once. Sorry, you are right. I claim temporary blindness. From debbugs-submit-bounces@debbugs.gnu.org Thu May 18 19:49:01 2023 Received: (at 63470) by debbugs.gnu.org; 18 May 2023 23:49:01 +0000 Received: from localhost ([127.0.0.1]:54818 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pznMj-0003HF-Fj for submit@debbugs.gnu.org; Thu, 18 May 2023 19:49:01 -0400 Received: from out4-smtp.messagingengine.com ([66.111.4.28]:54453) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pznMg-0003H2-KY for 63470@debbugs.gnu.org; Thu, 18 May 2023 19:48:59 -0400 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 88B5C5C0166; Thu, 18 May 2023 19:48:53 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Thu, 18 May 2023 19:48:53 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm2; t= 1684453733; x=1684540133; bh=n38MoHGz3pmcGY30tRDqgIcxZ02z90Zb1hU W2auHTc0=; b=HDZf87GwtF65BszIbdtRHEwZm1zTCPTvKh6mla439cXSJtr4Oj2 C5aXPGGHXgqAjxpl/NjQx+HgNhlKU90KrH7vi4KkKhMSSSvipbBeRz88efP3Q3J2 me3KdapYWipmoG84jIF51ZTrhpJ57cgLLgC4hoicq5buks/zFQDLNMD9sJL2m2EH /nIM0zU5C/duC3LKBoF5L9Bp/QQrqFNul6FWrmAmPtNAfH9KL3kbI4XTgXSoFcKr ABsHLXLMzv8ob5u28kmcQjM2EVkgWS6aM7NJzZO6LTQjjUbKEZPyvtabbiZmuNoL KOxjMV0SG8MbgzBOjVrJH72wGRKzDKK59Kg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t= 1684453733; x=1684540133; bh=n38MoHGz3pmcGY30tRDqgIcxZ02z90Zb1hU W2auHTc0=; b=iKcWFWg4UAC1UarmyCaG1ZKU9gvvYTbD2rI6/WcPO3+HHCv+NaJ W2+k3XAmsW3htuayj8aiT/7JjtcA0MuqNnLCRzJoN2o1ut+w93thYJOuhHfHVPdu hlgAUHY5iqHRoSu8JOjVpEkLpIoFuSN3gobu7/YzSPuVfUg5UbFdTI8dQusvx5Bg TAtRww0tuR1tChPj26FgdnAMnJ21WqP/RDlHwImz5MTRd2QTEV3rT2GfsclyfbqX +HcISSah2s24SNdClBEjnwW+uZmnnppOlkeh7MLSZNZE8RYhNeyUbWWqY9ClT9mF IQL8PH97OAT3uGFBlm3hpGf0B0qKN51sEgg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrfeeigedgvdejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvvehfhfgjtgfgsehtjeertddtfeejnecuhfhrohhmpeffmhhi thhrhicuifhuthhovhcuoegumhhithhrhiesghhuthhovhdruggvvheqnecuggftrfgrth htvghrnhepiefgteevheevveffheeltdeukeeiieekueefgedugfefgefhudelgfefveel vdevnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepug hmihhtrhihsehguhhtohhvrdguvghv X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 18 May 2023 19:48:52 -0400 (EDT) Message-ID: <7a9b305b-44b2-38e2-85d6-88c516688e66@gutov.dev> Date: Fri, 19 May 2023 02:48:50 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Subject: Re: bug#63470: [PATCH] Use faster option for running vc-hg status Content-Language: en-US To: Spencer Baugh , Eli Zaretskii References: <83h6shbaiv.fsf@gnu.org> <83bkiobwsu.fsf@gnu.org> From: Dmitry Gutov In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -1.8 (-) X-Debbugs-Envelope-To: 63470 Cc: 63470@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.8 (--) On 16/05/2023 23:39, Spencer Baugh wrote: > Eli Zaretskii writes: > >>> Date: Fri, 12 May 2023 23:10:05 +0300 >>> Cc:63470@debbugs.gnu.org >>> From: Dmitry Gutov >>> >>> On 12/05/2023 22:57, Spencer Baugh wrote: >>>> I could add a user option to revert to the old behavior, if you want. >>> We could cache it like we do with vc-git--program-version. That's a >>> simple memoization that doesn't take the host into account (though that >>> could be implemented, too). >> Yes, that'd be a good-enough solution. >> >>> But it'd really make things easier if we're just allowed to rely on some >>> new enough versions of Git and Hg. >> It isn't easy to be backward-compatible, but we should strive at doing >> that. > OK, revised backwards-compatible patch attached. > Thanks! It does look better, performance-wise. Would you say that the performance of project--vc-list-files could be similarly improved for Hg? Or does the Rust implementation in question already get used for 'hg status .', as long as there is no "re:" involved? From debbugs-submit-bounces@debbugs.gnu.org Fri May 19 10:35:07 2023 Received: (at 63470) by debbugs.gnu.org; 19 May 2023 14:35:07 +0000 Received: from localhost ([127.0.0.1]:57058 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q01CE-00081R-QZ for submit@debbugs.gnu.org; Fri, 19 May 2023 10:35:07 -0400 Received: from mxout5.mail.janestreet.com ([64.215.233.18]:55129) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q01CD-00080h-AA for 63470@debbugs.gnu.org; Fri, 19 May 2023 10:35:05 -0400 From: Spencer Baugh To: Dmitry Gutov Subject: Re: bug#63470: [PATCH] Use faster option for running vc-hg status In-Reply-To: <7a9b305b-44b2-38e2-85d6-88c516688e66@gutov.dev> (Dmitry Gutov's message of "Fri, 19 May 2023 02:48:50 +0300") References: <83h6shbaiv.fsf@gnu.org> <83bkiobwsu.fsf@gnu.org> <7a9b305b-44b2-38e2-85d6-88c516688e66@gutov.dev> Date: Fri, 19 May 2023 10:34:59 -0400 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 63470 Cc: 63470@debbugs.gnu.org, Eli Zaretskii X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Dmitry Gutov writes: > On 16/05/2023 23:39, Spencer Baugh wrote: >> Eli Zaretskii writes: >> >>>> Date: Fri, 12 May 2023 23:10:05 +0300 >>>> Cc:63470@debbugs.gnu.org >>>> From: Dmitry Gutov >>>> >>>> On 12/05/2023 22:57, Spencer Baugh wrote: >>>>> I could add a user option to revert to the old behavior, if you want. >>>> We could cache it like we do with vc-git--program-version. That's a >>>> simple memoization that doesn't take the host into account (though that >>>> could be implemented, too). >>> Yes, that'd be a good-enough solution. >>> >>>> But it'd really make things easier if we're just allowed to rely on some >>>> new enough versions of Git and Hg. >>> It isn't easy to be backward-compatible, but we should strive at doing >>> that. >> OK, revised backwards-compatible patch attached. >> > > Thanks! It does look better, performance-wise. > > Would you say that the performance of project--vc-list-files could be > similarly improved for Hg? Or does the Rust implementation in question > already get used for 'hg status .', as long as there is no "re:" > involved? As of very recently in Mercurial trunk, yes, the Rust implementation will be used for project--vc-list-files. (It only just got support for -0) Although note: currently the Rust implementation doesn't support "hg status somefile"; that will fall back to the Python implementation. So "hg status ." would be slow, actually, but "hg status" (as project--vc-list-files inexplicably seems to do, despite passing "." for file-or-list, based on inspecting with (vc-edit-next-command)) is fast. (either way though, I'm working on making "hg status somefile" work in Rust, since that will make vc-hg-state fast) From debbugs-submit-bounces@debbugs.gnu.org Mon May 22 13:58:16 2023 Received: (at 63470) by debbugs.gnu.org; 22 May 2023 17:58:16 +0000 Received: from localhost ([127.0.0.1]:36329 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q19nT-0003ZQ-PE for submit@debbugs.gnu.org; Mon, 22 May 2023 13:58:16 -0400 Received: from mxout5.mail.janestreet.com ([64.215.233.18]:37015) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q19nP-0003ZA-I3 for 63470@debbugs.gnu.org; Mon, 22 May 2023 13:58:14 -0400 From: Spencer Baugh To: Eli Zaretskii Subject: Re: bug#63470: [PATCH] Use faster option for running vc-hg status In-Reply-To: <83ilcrxjci.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 17 May 2023 14:55:57 +0300") References: <83h6shbaiv.fsf@gnu.org> <83bkiobwsu.fsf@gnu.org> <83o7mjxk3i.fsf@gnu.org> <83ilcrxjci.fsf@gnu.org> Date: Mon, 22 May 2023 13:58:06 -0400 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 63470 Cc: dmitry@gutov.dev, 63470@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain A fix to the patch: passing the correct configuration key as an argument. The old version did nothing... but fortunately it was setting the configuration key to its default value, so it happened to work. I've tested now that it works even when commands.status.relative=0 is set by the user's hgrc. --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-Use-faster-option-for-running-vc-hg-status-Bug-63470.patch >From ff6163fac51759945aa619ca6bf28413be4a53e0 Mon Sep 17 00:00:00 2001 From: Spencer Baugh Date: Fri, 12 May 2023 15:28:06 -0400 Subject: [PATCH] Use faster option for running vc-hg status (Bug#63470) In modern Mercurial, removing the "re:" "-I" "." options provides a 10x-20x speedup because it allows the Rust implementation of "hg status" to be used. * lisp/vc/vc-hg.el (vc-hg--program-version): Add. (vc-hg-dir-status-files): Use --config commands.status.relative=1 to make paths relative when available. --- lisp/vc/vc-hg.el | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/lisp/vc/vc-hg.el b/lisp/vc/vc-hg.el index 78231a0c954..688fb6e0252 100644 --- a/lisp/vc/vc-hg.el +++ b/lisp/vc/vc-hg.el @@ -1377,17 +1377,28 @@ vc-hg-after-dir-status ;; Follows vc-exec-after. (declare-function vc-set-async-update "vc-dispatcher" (process-buffer)) +(defvar vc-hg--program-version nil) + +(defun vc-hg--program-version () + (or vc-hg--program-version + (setq vc-hg--program-version + (with-temp-buffer + (condition-case _ (vc-hg-command t 0 nil "version") + (error "0") + (:success + (goto-char (point-min)) + (re-search-forward "Mercurial Distributed SCM (version \\([0-9][0-9.]+\\)") + (string-trim-right (match-string 1) "\\."))))))) + (defun vc-hg-dir-status-files (dir files update-function) ;; XXX: We can't pass DIR directly to 'hg status' because that ;; returns all ignored files if FILES is non-nil (bug#22481). (let ((default-directory dir)) - ;; TODO: Use "--config 'status.relative=1'" instead of "re:" - ;; when we're allowed to depend on Mercurial 4.2+ - ;; (it's a bit faster). - (vc-hg-command (current-buffer) 'async files - "status" "re:" "-I" "." - (concat "-mardu" (if files "i")) - "-C")) + (apply #'vc-hg-command (current-buffer) 'async files + "status" (concat "-mardu" (if files "i")) "-C" + (if (version<= "4.2" (vc-hg--program-version)) + '("--config" "commands.status.relative=1") + '("re:" "-I" ".")))) (vc-run-delayed (vc-hg-after-dir-status update-function))) -- 2.30.2 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Mon May 22 18:33:41 2023 Received: (at 63470) by debbugs.gnu.org; 22 May 2023 22:33:42 +0000 Received: from localhost ([127.0.0.1]:37142 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q1E61-0003Wi-Lb for submit@debbugs.gnu.org; Mon, 22 May 2023 18:33:41 -0400 Received: from out2-smtp.messagingengine.com ([66.111.4.26]:36041) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q1E60-0003WW-5Z for 63470@debbugs.gnu.org; Mon, 22 May 2023 18:33:40 -0400 Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 201195C011B; Mon, 22 May 2023 18:33:35 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Mon, 22 May 2023 18:33:35 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm3; t= 1684794815; x=1684881215; bh=4A2qAH7ZQRuGUJROFNMBZULbaduTcVulAzc 2irziUrE=; b=CmpVx4qzUd0rW1JD1waahC6n2MjttbJ9hMibmHGvQCg6WqsVCkm W3xXgZ6RNNhZ0DWv6dxunfUWrbRtkUUQKxtCoeewwk8c3UL20qbixquwCxmxvUMl ZkkbxYQ3STk1Uz3SspQ3UKSOn/TSY9k6h3SQnPfdjFds85ei1DZI9SLSoJPLoR8m fedR5fa5GV5tPNPTSGu9he+k3FxtPndjNekLLBNt+rcekzAkdqLOueRf/7e+bGrJ qfa13g2H+jDdWTRu6mt0TMjOuuKDhvo+QGIJhfami/8MsWN27ImronvDSN53fyyX jwopS4rBFOoR4xA+hsczSe80Zpl5YTFQu5A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t= 1684794815; x=1684881215; bh=4A2qAH7ZQRuGUJROFNMBZULbaduTcVulAzc 2irziUrE=; b=WCmALlhReR+28vzNkIZmnAoKPhm22CuO9ES/6PZZSG3+RJIS0S5 jqXCVkDhU3Mw90wVGHHFZYBsr7PRrY9G53Bo//ZuoW0/jdmMGNeKBS5YLZ+juDeo d/uNpDdkmHJAhpLO8222GOWT946xy4Vq5ajiMNJQhKnf9SEwzCHfMCvOawTdZnw4 S17fDpxrzEheOIiZD0gw66rtliV+UBrxA8KcqIeOEoP1KNsCcZKYQ+ahs8d3NI6f zwgOBW0qskk5+9E3c/n9x330z43UqtKvyMy4pwoWTHSeCSB9c03choS2n+1s4W3V 2/iLTzVqXqxz/ea3Q3SQ/5RDFHRGiN/z7Hw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrfeejvddgudduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvvehfhfgjtgfgsehtjeertddtfeejnecuhfhrohhmpeffmhhi thhrhicuifhuthhovhcuoegumhhithhrhiesghhuthhovhdruggvvheqnecuggftrfgrth htvghrnhepiefgteevheevveffheeltdeukeeiieekueefgedugfefgefhudelgfefveel vdevnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepug hmihhtrhihsehguhhtohhvrdguvghv X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 22 May 2023 18:33:34 -0400 (EDT) Message-ID: <3f158aa2-806a-0275-20d3-644f6c5a0633@gutov.dev> Date: Tue, 23 May 2023 01:33:33 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Subject: Re: bug#63470: [PATCH] Use faster option for running vc-hg status Content-Language: en-US To: Spencer Baugh References: <83h6shbaiv.fsf@gnu.org> <83bkiobwsu.fsf@gnu.org> <7a9b305b-44b2-38e2-85d6-88c516688e66@gutov.dev> From: Dmitry Gutov In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -1.8 (-) X-Debbugs-Envelope-To: 63470 Cc: 63470@debbugs.gnu.org, Eli Zaretskii X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.8 (--) On 19/05/2023 17:34, Spencer Baugh wrote: >> Thanks! It does look better, performance-wise. >> >> Would you say that the performance of project--vc-list-files could be >> similarly improved for Hg? Or does the Rust implementation in question >> already get used for 'hg status .', as long as there is no "re:" >> involved? > As of very recently in Mercurial trunk, yes, the Rust implementation > will be used for project--vc-list-files. (It only just got support for > -0) > > Although note: currently the Rust implementation doesn't support "hg > status somefile"; that will fall back to the Python implementation. So > "hg status ." would be slow, actually, but "hg status" (as > project--vc-list-files inexplicably seems to do, despite passing "." for > file-or-list, based on inspecting with (vc-edit-next-command)) is fast. > > (either way though, I'm working on making "hg status somefile" work in > Rust, since that will make vc-hg-state fast) Nice! Thank you. From debbugs-submit-bounces@debbugs.gnu.org Mon May 22 18:33:19 2023 Received: (at 63470-done) by debbugs.gnu.org; 22 May 2023 22:33:19 +0000 Received: from localhost ([127.0.0.1]:37138 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q1E5f-0003W8-8n for submit@debbugs.gnu.org; Mon, 22 May 2023 18:33:19 -0400 Received: from out2-smtp.messagingengine.com ([66.111.4.26]:59941) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q1E5c-0003Vv-Hr for 63470-done@debbugs.gnu.org; Mon, 22 May 2023 18:33:18 -0400 Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id 7BBDE5C0085; Mon, 22 May 2023 18:33:11 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Mon, 22 May 2023 18:33:11 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm3; t= 1684794791; x=1684881191; bh=crW72AKtJLvDAJuMWiihMDbszZGH9Jry55y O2alDOG4=; b=XL3tg1bEjny2aCh6sJzf3Y90eIh4GX0dItBLW77Mqq1J9b39sZv gzrMsvE5lZz6cmKYQpijSwnUYaQeTVBs5xcuRBWNoIcI0mgAZgU0mh7brEiDwHMh 6BKgfYZ073HxHCg0Dmi/1m2Kb7KswxPh40D+mjkxbX5kQit3ax3JoWEzT5lgJHNT BMZsiXA/vFj5IJUwfQI4dAUsK+q7I9fyQgJFerJqnz0CRUOGn/8LlhPeTi32zY2v 22VfkCqYbnQVkl19E/sKxf5Ad89uqq2oWtUk11Xz+Xvd5nK+6qWKf6bEHoYJ5f2c cLaM0VuIyHbg3NHBa3Mer6inT9L2LgJ+QwA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t= 1684794791; x=1684881191; bh=crW72AKtJLvDAJuMWiihMDbszZGH9Jry55y O2alDOG4=; b=o5SRdc1fS/Xh1GyLc37aq1YpFbbVBM5F8zJGV6j0FgQjMMHOt8N PuA5R1QNmb1rnr90GxSRl0DGDhW3J3+Oq9iXHFNk7kIu8tsG/R8qD2UJmt1+7QP0 mVyiYRrZDuMOqI30AWUul+OfOw2MxLkvqY9f3dLcfN39IBA9Lw+fH02Y67A1jj6H R0O1ZO4I0Too+/urF38dNlqqRFQTsGrDEoxo0X6pT75NT9kKzFgDwy6/kxsoIRBX 5z7j+iMXnokqqyPjLBenYnNXAxhkaobxlrgjJUOl9TO0ksjqo/lFSZIAkArg405v LNlDWSFjUROeecj91Nyn5ViguqVLsh/TkwA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrfeejvddgudduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvvehfhfgjtgfgsehtjeertddtfeejnecuhfhrohhmpeffmhhi thhrhicuifhuthhovhcuoegumhhithhrhiesghhuthhovhdruggvvheqnecuggftrfgrth htvghrnhepiefgteevheevveffheeltdeukeeiieekueefgedugfefgefhudelgfefveel vdevnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepug hmihhtrhihsehguhhtohhvrdguvghv X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 22 May 2023 18:33:10 -0400 (EDT) Message-ID: Date: Tue, 23 May 2023 01:33:08 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Subject: Re: bug#63470: [PATCH] Use faster option for running vc-hg status Content-Language: en-US To: Spencer Baugh , Eli Zaretskii References: <83h6shbaiv.fsf@gnu.org> <83bkiobwsu.fsf@gnu.org> <83o7mjxk3i.fsf@gnu.org> <83ilcrxjci.fsf@gnu.org> From: Dmitry Gutov In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -1.8 (-) X-Debbugs-Envelope-To: 63470-done Cc: 63470-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.8 (--) Version: 30.1 On 22/05/2023 20:58, Spencer Baugh wrote: > A fix to the patch: passing the correct configuration key as an > argument. The old version did nothing... but fortunately it was setting > the configuration key to its default value, so it happened to work. > I've tested now that it works even when commands.status.relative=0 is > set by the user's hgrc. Thanks! Installed. Am I right to understand, BTW, that the supposed 10x speedup will only materialize with a very new Mercurial? With Hg 6.2.2 I see a small improvement here, but it's more like 10% bump than a 1000% one. From unknown Tue Sep 09 21:32:56 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Tue, 20 Jun 2023 11:24:09 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator