Subject: Re: bug#24126: vc-hg-state can be extremely slow

From: Lars Ingebrigtsen <[email-masked]>
Date: Wed, 18 Aug 2021 16:39:57 +0200

Dmitry Gutov <[email-masked]> writes:

> I think that only happens once per root per Emacs session (after that
> the directory's backend is cached).

Yup.  If I instrument the function and then do a vc-root-diff in a fresh
Emacs session, I get the expected backtrace:

Debugger entered--entering a function:
* vc-hg-state("/tmp/hg/")
  apply(vc-hg-state "/tmp/hg/")
  vc-call-backend(Hg state "/tmp/hg/")
  vc-state-refresh("/tmp/hg/" Hg)
  vc-state("/tmp/hg/" Hg)
  vc-hg-registered("/tmp/hg/")
  apply(vc-hg-registered "/tmp/hg/")
  vc-call-backend(Hg registered "/tmp/hg/")
  #f(compiled-function (b) #<bytecode -0x1056748a7cc3b17d>)(Hg)
  mapc(#f(compiled-function (b) #<bytecode -0x1056748a7cc3b17d>) (RCS CVS SVN SCCS SRC Bzr Git Hg))
  vc-registered("/tmp/hg/")
  vc-backend("/tmp/hg/")
  vc-working-revision("/tmp/hg/")
  vc-root-diff(nil)
  eval((vc-root-diff nil) t)
  eval-expression((vc-root-diff nil) nil nil 127)
  funcall-interactively(eval-expression (vc-root-diff nil) nil nil 127)
  call-interactively(eval-expression nil nil)
  command-execute(eval-expression)

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no