git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Shawn O. Pearce" <spearce@spearce.org>
To: Kirill Smelkov <kirr@mns.spb.ru>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] Speedup bash completion loading
Date: Mon, 5 Oct 2009 08:25:04 -0700	[thread overview]
Message-ID: <20091005152504.GE9261@spearce.org> (raw)
In-Reply-To: <1254737039-10404-1-git-send-email-kirr@mns.spb.ru>

Kirill Smelkov <kirr@mns.spb.ru> wrote:
> I've tracked down that the most time is spent warming up merge_strategy,
> all_command & porcelain_command caches.

Nak.

The problem is, during completion when we modify the value the
change doesn't persist beyond the current completion invocation.
Thus there is no value in the cache, so every completion attempt
which needs the list has to rerun the command to compute it.

 
> diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
> index 2c2a0d4..4c09d41 100755
> --- a/contrib/completion/git-completion.bash
> +++ b/contrib/completion/git-completion.bash
> @@ -340,7 +340,6 @@ __git_merge_strategies ()
>  	}'
>  }
>  __git_merge_strategylist=
> -__git_merge_strategylist=$(__git_merge_strategies 2>/dev/null)
>  
>  __git_complete_file ()
>  {
> @@ -505,7 +504,6 @@ __git_all_commands ()
>  	done
>  }
>  __git_all_commandlist=
> -__git_all_commandlist="$(__git_all_commands 2>/dev/null)"
>  
>  __git_porcelain_commands ()
>  {
> @@ -596,7 +594,6 @@ __git_porcelain_commands ()
>  	done
>  }
>  __git_porcelain_commandlist=
> -__git_porcelain_commandlist="$(__git_porcelain_commands 2>/dev/null)"
>  
>  __git_aliases ()
>  {
> -- 
> 1.6.5.rc2.17.gdbc1b
> 

-- 
Shawn.

  reply	other threads:[~2009-10-05 15:32 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-05 10:03 [PATCH] Speedup bash completion loading Kirill Smelkov
2009-10-05 15:25 ` Shawn O. Pearce [this message]
2009-10-05 16:58   ` Kirill Smelkov
2009-10-05 19:18     ` Ted Pavlic
2009-10-08 13:27       ` Kirill Smelkov
2009-10-08 15:02         ` Shawn O. Pearce
2009-10-08 15:10           ` Kirill Smelkov
2009-10-09  9:09           ` Kirill Smelkov
2009-10-09 14:46             ` Shawn O. Pearce
2009-10-09 15:21               ` Kirill Smelkov
2009-10-09 15:39                 ` Shawn O. Pearce
2009-10-09 16:08                   ` Kirill Smelkov
2009-10-09 16:14                     ` Shawn O. Pearce
2009-10-10  0:57                       ` Junio C Hamano

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=20091005152504.GE9261@spearce.org \
    --to=spearce@spearce.org \
    --cc=git@vger.kernel.org \
    --cc=kirr@mns.spb.ru \
    /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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).