From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Spencer Baugh Newsgroups: gmane.emacs.bugs Subject: bug#66364: 29.1.50; vc-hg-registered/state are slow on directories of large repos Date: Thu, 05 Oct 2023 11:33:32 -0400 Message-ID: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="23890"; mail-complaints-to="usenet@ciao.gmane.io" To: 66364@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Oct 05 17:35:11 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 1qoQNb-00061z-6v for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 05 Oct 2023 17:35:11 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qoQNC-0000OA-Gi; Thu, 05 Oct 2023 11:34:46 -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 1qoQNB-0000O0-97 for bug-gnu-emacs@gnu.org; Thu, 05 Oct 2023 11:34:45 -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 1qoQNA-0007jo-Sb for bug-gnu-emacs@gnu.org; Thu, 05 Oct 2023 11:34:44 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qoQNS-00075r-Ac for bug-gnu-emacs@gnu.org; Thu, 05 Oct 2023 11:35:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Spencer Baugh Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 05 Oct 2023 15:35:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 66364 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.169652004727196 (code B ref -1); Thu, 05 Oct 2023 15:35:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 5 Oct 2023 15:34:07 +0000 Original-Received: from localhost ([127.0.0.1]:48275 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qoQMZ-00074Z-Fm for submit@debbugs.gnu.org; Thu, 05 Oct 2023 11:34:07 -0400 Original-Received: from lists.gnu.org ([2001:470:142::17]:38598) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qoQMX-000745-2f for submit@debbugs.gnu.org; Thu, 05 Oct 2023 11:34: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 1qoQM8-0000JE-SK for bug-gnu-emacs@gnu.org; Thu, 05 Oct 2023 11:33:40 -0400 Original-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 1qoQM2-0007WH-8E for bug-gnu-emacs@gnu.org; Thu, 05 Oct 2023 11:33:40 -0400 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, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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:271881 Archived-At: vc-hg-state (and vc-hg-registered, which calls vc-hg-state) are slow when run on directories of large repos. In fact they're O(N) in the number of files in the repo. This is because vc-hg-state-slow runs "hg status" on directories in a mode which lists all the files in the directory, and then it parses that list. Which is pointlessly slow. However, Hg (like git) does not actually track directories. So in the end vc-hg-state on a directory should always be returning 'unregistered, which matches the existing behavior of vc-hg (vc-hg-registered always returned nil for directories) and is much faster. (It also matches what vc-git does.) A patch to do this will follow