From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Jonathan Kotta Newsgroups: gmane.emacs.bugs Subject: bug#24126: vc-hg-state can be extremely slow Date: Mon, 1 Aug 2016 13:40:36 -0500 Message-ID: NNTP-Posting-Host: blaine Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a113ab0460348a8053906f219 X-Trace: blaine.gmane.org 1470076939 3565 195.159.176.226 (1 Aug 2016 18:42:19 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 1 Aug 2016 18:42:19 +0000 (UTC) To: 24126@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Aug 01 20:42:15 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bUIAI-0000g7-Oe for geb-bug-gnu-emacs@m.gmane.org; Mon, 01 Aug 2016 20:42:15 +0200 Original-Received: from localhost ([::1]:52328 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bUIAF-0002V1-Bz for geb-bug-gnu-emacs@m.gmane.org; Mon, 01 Aug 2016 14:42:11 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:45017) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bUIA8-0002Ug-GF for bug-gnu-emacs@gnu.org; Mon, 01 Aug 2016 14:42:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bUIA6-0007YA-BE for bug-gnu-emacs@gnu.org; Mon, 01 Aug 2016 14:42:03 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:55861) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bUIA6-0007Y6-7f for bug-gnu-emacs@gnu.org; Mon, 01 Aug 2016 14:42:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1bUIA6-0005a7-0I for bug-gnu-emacs@gnu.org; Mon, 01 Aug 2016 14:42:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Jonathan Kotta Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 01 Aug 2016 18:42:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 24126 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.147007689021415 (code B ref -1); Mon, 01 Aug 2016 18:42:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 1 Aug 2016 18:41:30 +0000 Original-Received: from localhost ([127.0.0.1]:53158 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bUI9a-0005ZL-Fx for submit@debbugs.gnu.org; Mon, 01 Aug 2016 14:41:30 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:53929) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bUI9Y-0005Z4-7H for submit@debbugs.gnu.org; Mon, 01 Aug 2016 14:41:28 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bUI9R-0007US-Or for submit@debbugs.gnu.org; Mon, 01 Aug 2016 14:41:22 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:39784) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bUI9R-0007UN-LY for submit@debbugs.gnu.org; Mon, 01 Aug 2016 14:41:21 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44900) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bUI9P-0002RH-6i for bug-gnu-emacs@gnu.org; Mon, 01 Aug 2016 14:41:20 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bUI9O-0007U7-6E for bug-gnu-emacs@gnu.org; Mon, 01 Aug 2016 14:41:19 -0400 Original-Received: from mail-pf0-x231.google.com ([2607:f8b0:400e:c00::231]:34656) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bUI9N-0007U2-RI for bug-gnu-emacs@gnu.org; Mon, 01 Aug 2016 14:41:18 -0400 Original-Received: by mail-pf0-x231.google.com with SMTP id p64so57884550pfb.1 for ; Mon, 01 Aug 2016 11:41:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to; bh=iNw5z4CMox7reLDFWdpSpI+njm6m6ZfQ3zVILI/aeWk=; b=Esozb9fdSOpSizsUhHpHm8Q2FTH3SCy265sVL62IiJ3AraVjI9CSJIZ6M2P8/o2XJk Bli6kxqwmPsT1KgEvUrJOzH25+rSkWdXZf+lwpQB0D/b4nlUI4EZpLYmH8idCIvIbljm f2s7xtFQjl3JuhfK9mPXKQrRNvlVfEacNXbEWp5YdRrzBSRjd7e6FGNb/JjFcd1ejM13 xq+f+L4DqsvkAtsfDX0LnmVve+A4xdtQ2sv9htqgC6fBPRQjVVhusrQQhdnqg59SeJWf /lQUv1NdeV+25XlUiiNiL+t0dzSEn3fhog8WKPHfNQDJy7856FEcmRXWPJrVoQbf9EYp az2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=iNw5z4CMox7reLDFWdpSpI+njm6m6ZfQ3zVILI/aeWk=; b=Jjc0TjHjFOKstfyY7ASrXH+MEutPSA6cklbk/3ntyzFGRs0ldvqr6fZv1WRgsqeNyk 7JCRVAT0prSOL4NoqD2n05tT55Idh76tYA9ofAHax0P7t9pZfzYsj81/czwyFKKLmExV aeyoFsBELXkB8bqatKenJZxODxYzHGhfUoobUjn+HbUTqiH8EpOzgugZuX0yDALjqMaX JyRgw6LuCGr3BSNeM2yLoyd+zA1wx4DYycTUP1x1uYtkTaR3Yoql/ArFuXX8Hjcx9bQr fGrH5yEP1bELXSMrp3P9HXQmY8J8MoNpwxPAns8X77qA5iwc7FZtiRDoc0dqNP1sgUjU vT3Q== X-Gm-Message-State: AEkooutHwgO5FG4piRkyoXlaj9KYB+ieN77BTMnq8+alMkpczN24VyJcnBuV81voV8Zi0uz88d1ORQtjPTE28A== X-Received: by 10.98.102.79 with SMTP id a76mr98444341pfc.75.1470076876439; Mon, 01 Aug 2016 11:41:16 -0700 (PDT) Original-Received: by 10.66.249.231 with HTTP; Mon, 1 Aug 2016 11:40:36 -0700 (PDT) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:121760 Archived-At: --001a113ab0460348a8053906f219 Content-Type: text/plain; charset=UTF-8 Emacs uses `hg status -A` in vc-hg-state, which in turn is used in many vc commands (e.g. vc-root-diff). The "-A" option makes mercurial look at all files under the directory, even the ignored ones. If there are a lot of ignored files, this will be very slow. As an example, I have a repo that's 38MB / 300 files when freshly checked out, and 34GB / 1.2M files when the build finishes (if you're curious, it's a yocto project). Without clearing the disk cache, `hg stat -A > /dev/null` takes 28s; it's far longer if the disk cache isn't warmed up or the output is actually used. `hg status` takes about 90ms. vg-git-state does not have this problem; currently it behaves like `hg status`, i.e. honoring the ignore rules. There is actually a FIXME comment regarding this functionality, noting that `git ls-files -i -o --exclude-standard` is the equivalent to `hg status -A`; this takes over 400s (I got sick of waiting). I'm guessing VC has some sort of assumption that vc-x-state will return all files. Maybe the command could bailout after taking too long and use `hg status`. Maybe the command options could be configurable. Personally, I'd prefer just dropping the "-A", because I've never used it and I don't really see why you'd want to get ignored files by default; this is my current solution. I'm using Emacs 24.5.1. I've tested Emacs 25.1.1 and it still has the issue; though vc-hg-state has changed, it still uses "-A" and is still very slow on my repo. -- Thanks, Jonathan Kotta Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law. --001a113ab0460348a8053906f219 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Emacs uses `hg status -A` in vc-hg-state, which in tu= rn is used in many vc commands (e.g. vc-root-diff).=C2=A0 The "-A"= ; option makes mercurial look at all files under the directory, even the ig= nored ones.=C2=A0 If there are a lot of ignored files, this will be very sl= ow. =C2=A0

As an example, I have a repo that's= 38MB / 300 files when freshly checked out, and 34GB / 1.2M files when the = build finishes (if you're curious, it's a yocto project).=C2=A0 Wit= hout clearing the disk cache, `hg stat -A > /dev/null` takes 28s; it'= ;s far longer if the disk cache isn't warmed up or the output is actual= ly used. =C2=A0`hg status` takes about 90ms. =C2=A0

vg-git-state does not have this problem; currently it behaves like `hg st= atus`, i.e. honoring the ignore rules. =C2=A0 There is actually a FIXME com= ment regarding this functionality, noting that `git ls-files -i -o --exclud= e-standard` is the equivalent to `hg status -A`; this takes over 400s (I go= t sick of waiting).

I'm guessing VC has some s= ort of assumption that vc-x-state will return all files.=C2=A0 Maybe the co= mmand could bailout after taking too long and use `hg status`.=C2=A0 Maybe = the command options could be configurable.=C2=A0 Personally, I'd prefer= just dropping the "-A", because I've never used it and I don= 't really see why you'd want to get ignored files by default; this = is my current solution.

I'm using Emacs 24.5.1= .=C2=A0 I've tested Emacs 25.1.1 and it still has the issue; though vc-= hg-state has changed, it still uses "-A" and is still very slow o= n my repo.

--
Tha= nks,

Jonathan Kotta

Hofstadter's Law:
=C2=A0 =C2=A0 It= always takes longer than you expect, even
=C2=A0 =C2=A0 when you take i= nto account Hofstadter's Law.
--001a113ab0460348a8053906f219--