all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Alex Harsanyi <alexharsanyi@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: emacs-devel@gnu.org
Subject: Re: vc-dir operation is very slow on large git repositories in Emacs 26.1
Date: Fri, 22 Jun 2018 17:46:00 +0800	[thread overview]
Message-ID: <C6EEB4A0-653C-432B-979E-84AB78FB78DC@gmail.com> (raw)
In-Reply-To: <83efgzqjv5.fsf@gnu.org>



On 22 Jun 2018, at 4:57 pm, Eli Zaretskii <eliz@gnu.org> wrote:

>> From: Alex Harsanyi <alexharsanyi@gmail.com>
>> Date: Fri, 22 Jun 2018 09:12:29 +0800
>> Cc: emacs-devel@gnu.org
>> 
>> I set `vc-command-messages`, which prints out the subprocesses run by
>> `vc-do-command` and also updated `vc-do-command` to show the time it took for
>> each process.  It turns out that Emacs 26.1 does run one extra command:
>> 
>> In Emacs 25.2, a "vc-dir" command runs the following:
>> 
>> Running git --no-pager update-index --refresh . in background... done
>> 0.48 seconds
>> Running git --no-pager diff-index --relative -z -M HEAD -- . in
>> background... done 0.42 seconds
>> Running git --no-pager ls-files -z -o --directory --no-empty-directory
>> --exclude-standard -- . in background... done 0.10 seconds
>> 
>> In Emacs 26.2, a "vc-dir" command runs the following:
>> 
>> Running git --no-pager update-index --refresh . in background... done
>> 0.46 seconds
>> Running git --no-pager diff-index --relative -z -M HEAD -- . in
>> background... done 0.46 seconds
>> Running git --no-pager ls-files -z -c -s -- . in background... done 4.49 seconds
>> Running git --no-pager ls-files -z -o --directory --no-empty-directory
>> --exclude-standard -- . in background... done 0.09 seconds
>> 
>> The extra command is "git --no-pager ls-files -z -c -s -- ." and it takes 4.5
>> seconds to run (I ran each test multiple times and the times are consistent).
>> However, when I run that command in a terminal, it finishes in less than a
>> second.
> 
> But the times you cited originally were much longer: 2 min.  What
> caused such a stark difference, from 2 min to just 4.5 sec?

The repository at my work place has more than 50000 files and vc-dir takes 2 minutes (measured using a stopwatch) for that repo. 

These tests I did at home against the Emacs repository which had approximately 3000 files. Originally I said this takes about 7 seconds, but that was “measured” by counting slowly in my head, these latest numbers actually measure the exact time. 

> 
>> An Emacs-Lisp program to run this script, but ignore all output, it takes 16
>> seconds, in both 25.2 and 26.1:
> 
> Once again, 16 sec is much shorter than 2 min you originally cited.

The ls-files command from for my work repo generates 6.5 Mb of data, my test program only generated 1 Mb of data.

> 
>> It seems reading output from a process in Emacs is somehow limited to 64 Kb /
>> second -- I verified this with procmon.  It looks like the behavior is the
>> same in 25.2 and 26.1, it is just that in vc-dir 25.2 does not run a git
>> command that produces a lot of output.
> 
> Does it help to set w32-pipe-buffer-size to some large value, like
> 16384, and/or decrease w32-pipe-read-delay?

I will try that tonight. Thanks for the suggestion. 

Alex

> 
> Thanks.



  reply	other threads:[~2018-06-22  9:46 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-20 10:50 vc-dir operation is very slow on large git repositories in Emacs 26.1 Alex Harsanyi
2018-06-20 15:51 ` Eli Zaretskii
2018-06-20 22:33   ` Alex Harsanyi
2018-06-21 14:32     ` Eli Zaretskii
2018-06-22  1:12       ` Alex Harsanyi
2018-06-22  8:57         ` Eli Zaretskii
2018-06-22  9:46           ` Alex Harsanyi [this message]
2018-06-22 12:46           ` Alex Harsanyi
2018-06-22 18:24             ` Eli Zaretskii
2018-06-22 20:43               ` w32-pipe-read-delay (was: vc-dir operation is very slow on large git repositories in Emacs 26.1) Stefan Monnier
2018-06-23  7:21                 ` Eli Zaretskii
     [not found]                   ` <CAH-ciFrCk=pVTDUA+8F1XZSK40Wr21yzz3u=mutJ0NM3UdojNw@mail.gmail.com>
2018-06-23 13:30                     ` Fwd: " Alex Harsanyi
2018-06-23 13:32                       ` Alex Harsanyi
2018-06-23 13:40                         ` Eli Zaretskii
2018-06-23 14:00                           ` Alex Harsanyi
2018-06-23 14:31                             ` Eli Zaretskii
2018-06-30  8:46                               ` Eli Zaretskii
2018-06-25 10:40               ` vc-dir operation is very slow on large git repositories in Emacs 26.1 Alex Harsanyi
2018-06-25 11:09                 ` Bastian Beischer
2018-06-25 12:23                   ` Alex Harsanyi
2018-06-25 15:17                   ` Eli Zaretskii
2018-06-25 15:44                     ` Bastian Beischer
2018-06-25 16:23                       ` Eli Zaretskii
2018-06-25 22:28                         ` Alex Harsanyi
2018-06-25 14:51                 ` Eli Zaretskii
2018-06-22  9:04   ` Dmitry Gutov
2018-06-23 13:37     ` Eli Zaretskii
2018-06-23 18:28       ` Dmitry Gutov
2018-06-23 18:44         ` Eli Zaretskii
2018-06-25 12:55           ` Dmitry Gutov
2018-06-25 15:20             ` Eli Zaretskii
2018-06-26 15:14               ` Sergey Organov
2018-06-27  2:01                 ` Dmitry Gutov
2018-06-27  2:49                   ` Tom Tromey
2018-06-27  9:41                     ` Dmitry Gutov
2018-06-27 15:12                       ` Eli Zaretskii
2018-06-28  0:30                         ` Dmitry Gutov
2018-06-28 12:55                           ` Eli Zaretskii
2018-06-28 13:06                             ` Dmitry Gutov
2018-06-28 13:12                               ` Eli Zaretskii
2018-06-28 13:18                                 ` Dmitry Gutov
2018-06-28 13:38                                   ` Eli Zaretskii
2018-06-28 13:47                                     ` Dmitry Gutov
2018-06-28 14:00                                       ` Eli Zaretskii
2018-06-28 13:21                       ` Sergey Organov
2018-06-28 13:28                         ` Dmitry Gutov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=C6EEB4A0-653C-432B-979E-84AB78FB78DC@gmail.com \
    --to=alexharsanyi@gmail.com \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.