Re: [PATCH v2 10/13] bash prompt: combine 'git rev-parse' executions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Jun 18, 2013 at 04:17:03AM +0200, SZEDER Gábor wrote:

> The whole series speeds up the bash prompt on Windows/MSysGit
> considerably.  Here are some timing results in two scenarios, repeated
> 10 times:
> 
> At the top of the work tree, before:
> 
>     $ time for i in {0..9} ; do prompt="$(__git_ps1)" ; done
> 
>     real    0m1.716s
>     user    0m0.301s
>     sys     0m0.772s
> 
>   After:
> 
>     real    0m0.686s
>     user    0m0.075s
>     sys     0m0.287s
> 
> In a subdirectory, during rebase, stash status indicator enabled,
> before:
> 
>     real    0m3.557s
>     user    0m0.495s
>     sys     0m1.767s
> 
>   After:
> 
>     real    0m0.702s
>     user    0m0.045s
>     sys     0m0.409s

Very nice speedup (or perhaps it is a testament to how bad fork() is on
msys). Reading patches 8 and 9, I can't help but feel that "git status"
is letting us down a little by making us parse all of this data
ourselves. In theory, __git_ps1() could just be something like:

  eval "$(git status --shell)"
  printf ...

and the heavy lifting could be done in a single C process which does not
have to worry about fork overhead. But that is quite far from where we
are now, so while it might be an interesting place to go in the future,
I do not think such dreams would want to hold up current work.

-Peff
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]