Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: [PR] vcs_info-examples: optimize +vi-git-untracked() #76



On Tue, Jun 29, 2021 at 12:55 AM Suraj N. Kurapati <sunaku@xxxxxxxxxx> wrote:
>
> On Sun, 27 Jun 2021 15:03:17 +0200, Roman Perepelitsa wrote:
> > On Sun, Jun 27, 2021 at 8:07 AM Suraj N. Kurapati wrote:
> > > Speed up the prompt on large and/or deep working directories [...]
> >
> > Do you have an estimate of the speedup? Numbers from at least one
> > repository on one machine would be useful to see.
>
> I see a 4x speedup on a large Git-enabled home directory, as follows:
>
>     $ time (git status --porcelain | wc -l)
>     212
>     0.01s user 0.02s system 0% cpu 9.021 total
>
>     $ time (git status --porcelain | grep '??' &>/dev/null)
>     0.01s user 0.02s system 0% cpu 12.294 total
>
>     $ time (git status --porcelain | grep -q '^?? ' 2>/dev/null)
>     0.01s user 0.01s system 0% cpu 3.097 total

Thanks for posting these numbers.

So with your optimization it takes 3 seconds. That's quite a bit. And
I suppose that if you were to remove/add/ignore all untracked files,
it would go up to 9 seconds. Ouch!

Roman.




Messages sorted by: Reverse Date, Date, Thread, Author