Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [PR] vcs_info-examples: optimize +vi-git-untracked() #76
- X-seq: zsh-workers 49136
- From: Roman Perepelitsa <roman.perepelitsa@xxxxxxxxx>
- To: "Suraj N. Kurapati" <sunaku@xxxxxxxxxx>
- Cc: Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: Re: [PR] vcs_info-examples: optimize +vi-git-untracked() #76
- Date: Tue, 29 Jun 2021 09:16:40 +0200
- Archived-at: <https://zsh.org/workers/49136>
- In-reply-to: <20210628155736.6982862a@ratham>
- List-id: <zsh-workers.zsh.org>
- References: <20210626230903.43ba5516@ratham> <CAN=4vMp1MAi8ncK3n9V95m0AcE=jTG6qbYr+eRYVpWrsEMBY8Q@mail.gmail.com> <20210628155736.6982862a@ratham>
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