GNU bug report logs - #66364
29.1.50; vc-hg-registered/state are slow on directories of large repos

Previous Next

Package: emacs;

Reported by: Spencer Baugh <sbaugh <at> janestreet.com>

Date: Thu, 5 Oct 2023 15:35:02 UTC

Severity: minor

Tags: patch

Found in version 29.1.50

Done: Dmitry Gutov <dmitry <at> gutov.dev>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Dmitry Gutov <dmitry <at> gutov.dev>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#66364: closed (29.1.50; vc-hg-registered/state are slow on
 directories of large repos)
Date: Sat, 14 Oct 2023 17:03:02 +0000
[Message part 1 (text/plain, inline)]
Your message dated Sat, 14 Oct 2023 20:02:16 +0300
with message-id <240edc4e-b4ed-f146-8e64-c1fb5548e323 <at> gutov.dev>
and subject line Re: bug#66364: 29.1.50; vc-hg-registered/state are slow on directories of large repos
has caused the debbugs.gnu.org bug report #66364,
regarding 29.1.50; vc-hg-registered/state are slow on directories of large repos
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
66364: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=66364
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Spencer Baugh <sbaugh <at> janestreet.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 29.1.50; vc-hg-registered/state are slow on directories of large repos
Date: Thu, 05 Oct 2023 11:33:32 -0400
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


[Message part 3 (message/rfc822, inline)]
From: Dmitry Gutov <dmitry <at> gutov.dev>
To: sbaugh <at> catern.com
Cc: Spencer Baugh <sbaugh <at> janestreet.com>, 66364-done <at> debbugs.gnu.org
Subject: Re: bug#66364: 29.1.50; vc-hg-registered/state are slow on
 directories of large repos
Date: Sat, 14 Oct 2023 20:02:16 +0300
On 13/10/2023 04:09, sbaugh <at> catern.com wrote:
> Yes, I would be quite happy with deleting these unused lines.  Although
> I expect it's still nice to have the same optimization that vc-git does.
> 
> BTW, here's a version of my patch which follows vc-git and just returns
> nil for directories.

Certainly.

Installed both patches, thank you, and closing.


This bug report was last modified 1 year and 278 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.