From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.bugs Subject: bug#66364: 29.1.50; vc-hg-registered/state are slow on directories of large repos Date: Thu, 5 Oct 2023 19:09:52 +0300 Message-ID: <90fef338-cac6-aa08-bd74-5ce9e2721f76@gutov.dev> References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="23289"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 To: Spencer Baugh , 66364@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Oct 05 18:11:00 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 1qoQwE-0005ly-RI for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 05 Oct 2023 18:10:59 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qoQw2-0005p6-Lx; Thu, 05 Oct 2023 12:10: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 1qoQw0-0005ow-Kf for bug-gnu-emacs@gnu.org; Thu, 05 Oct 2023 12:10:44 -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 1qoQvz-0002FD-Tt for bug-gnu-emacs@gnu.org; Thu, 05 Oct 2023 12:10:44 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qoQwH-0004sA-RV for bug-gnu-emacs@gnu.org; Thu, 05 Oct 2023 12:11:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 05 Oct 2023 16:11:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 66364 X-GNU-PR-Package: emacs Original-Received: via spool by 66364-submit@debbugs.gnu.org id=B66364.169652222418680 (code B ref 66364); Thu, 05 Oct 2023 16:11:01 +0000 Original-Received: (at 66364) by debbugs.gnu.org; 5 Oct 2023 16:10:24 +0000 Original-Received: from localhost ([127.0.0.1]:48327 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qoQvg-0004rE-Ci for submit@debbugs.gnu.org; Thu, 05 Oct 2023 12:10:24 -0400 Original-Received: from out5-smtp.messagingengine.com ([66.111.4.29]:46563) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qoQvc-0004qs-5u for 66364@debbugs.gnu.org; Thu, 05 Oct 2023 12:10:22 -0400 Original-Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id 0575B5C047A; Thu, 5 Oct 2023 12:09:56 -0400 (EDT) Original-Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Thu, 05 Oct 2023 12:09:56 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=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=fm1; t= 1696522196; x=1696608596; bh=UhVRdo0qZ6uoPR7UEBS71Lv/zL9kwcIersW ioLBuZgo=; b=Q5ikQuPnGzCJt/DV8S2IY7ERrgNYxQG7SqMojY141fONTo02Uy/ 6jBZgcmKi1zMSziQcAtxLIZpo8flmmOnVbioJjTTLUJZClEP67PpTFghI2MYH5/2 en932iEF/TA8i8bKHCOeyp65Q6yE26ItarPcv8jte/2GcVNxqa2gV35EI/RNL2fF 7YsF7GXwVy+1dafbnWb1v+uq6/HldU/c0ykAGB4/vMDY32bh2uZ1Tdb9rZTsE/je TkamE8G/L1OnQTEHkG+mo6BFA+jSE/oBadh7DyCHPdT6VHPbie7GkVEPJ1LZgE2m svbCB3XSYWnueC+fnGyI3rxfnBcK+2fge8A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=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=fm2; t=1696522196; x= 1696608596; bh=UhVRdo0qZ6uoPR7UEBS71Lv/zL9kwcIersWioLBuZgo=; b=r I6O5DuXIelLZdWH5IbFIYw6ER9PS47PtDkjnkQ+vepUzY5vdOkNqtM27nqgBveJy gG1QnTqh0ggouq/O9wcTuSik30u2jx1QhYrNekUyzD08anp2zwKzW/Of2V8aQbpo qJ4axz9pe7g7sF39aUKGJ/NxPifiM0EmH2E5cXkXxYFW23vAtJaLlQht4qFB8vew G/d2gMlJ/EHAFflzk8iK8klAPPI4av9XahovoaH13nEfFcX49JGn7+7Wjrq8Ijtd S9Ijc7pFBV9pMu68xJ+QfV8EwF7VGdgojDvEgb05QAltd7Iws8I54Dm4xd/z5lM4 A2gdFkhyobgFFjkee7u0w== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrgeeggdelhecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefkffggfgfuvfhfhfgjtgfgsehtjeertddtfeejnecuhfhrohhmpeffmhhithhr hicuifhuthhovhcuoegumhhithhrhiesghhuthhovhdruggvvheqnecuggftrfgrthhtvg hrnhepgeehtdehudejieetuedttdejkeehjeetueekheffuddtjeeuvdefveeuveeiuddu necuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepughmih htrhihsehguhhtohhvrdguvghv X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 5 Oct 2023 12:09:54 -0400 (EDT) Content-Language: en-US In-Reply-To: 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:271884 Archived-At: On 05/10/2023 18:36, Spencer Baugh wrote: > From 5573b678f816f81623deb7ebde66dfd3ebe92355 Mon Sep 17 00:00:00 2001 > From: Spencer Baugh > Date: Thu, 5 Oct 2023 11:35:25 -0400 > Subject: [PATCH] Optimize vc-hg-state for directories > > Directories are never tracked in hg, so it's pointless to run > vc-hg-state on them. And, in fact, our implementation previously > would list all the files contained in the directory and then parse > that in Emacs, which is very slow in large repos. > > Let's just use the knowledge that directories aren't tracked in hg, > and skip running hg entirely. > > * lisp/vc/vc-hg.el (vc-hg-state): Return unregistered for directories. > --- > lisp/vc/vc-hg.el | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) > > diff --git a/lisp/vc/vc-hg.el b/lisp/vc/vc-hg.el > index c3e563a1f10..9a30706f519 100644 > --- a/lisp/vc/vc-hg.el > +++ b/lisp/vc/vc-hg.el > @@ -216,8 +216,10 @@ vc-hg-registered > > (defun vc-hg-state (file) > "Hg-specific version of `vc-state'." > - (let ((state (vc-hg-state-fast file))) > - (if (eq state 'unsupported) (vc-hg-state-slow file) state))) > + (if (file-directory-p file) > + 'unregistered > + (let ((state (vc-hg-state-fast file))) > + (if (eq state 'unsupported) (vc-hg-state-slow file) state)))) > > (defun vc-hg-state-slow (file) > "Determine status of FILE by running hg." Perhaps we should just follow the example of vc-git-registered and return nil. Could you mention which code calls 'registered' on a directory, though? If it's in-tree, that's probably a bug too.