git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: "Florian Gamböck" <ml@floga.de>
To: Stefan Beller <sbeller@google.com>
Cc: git <git@vger.kernel.org>, "Szeder Gábor" <szeder.dev@gmail.com>
Subject: Re: [RFC PATCH 1/1] completion: Load completion file for external subcommand
Date: Mon, 9 Apr 2018 21:49:55 +0200	[thread overview]
Message-ID: <20180409194955.GA22994@furore> (raw)
In-Reply-To: <CAGZ79kZzMDjKzuHn5ph+zMkh_9Zt_at37MssOjHvzJndUjt9yQ@mail.gmail.com>

On 2018-04-09 11:26, Stefan Beller wrote:
>> Since bash-completion started to use dynamical loading of completion 
>> scripts somewhere around v2.0, it is no longer sufficient to drop a 
>> completion script of a subcommand into the standard completions path, 
>> /usr/share/bash-completion/completions, since this script will not be 
>> loaded if called as a git subcommand.
>
> Also v1.90 here? (hint from the cover letter, please be exact)

Yes, it started at 1.90. I will reword the commit message and be more 
exact in the next iteration.

> If Gits own completion script would be broken up by subcommand, would 
> that also deliver an improvement in performance?

As it is now, the completion script is quite big. On a system with 
limited resources, the initial loading time can be long and the memory 
footprint is big, given that most users will just use a few commands. If 
you just use the "commit" subcommand, the first loading of the two 
(smaller) scripts will be slightly longer the first time (but not as 
long as with one big script, I think), but the footprint will be 
drastically lower. The whole script is 56kB big (without comments), 
after radically removing everything which is not connected to 
_git_commit, it is only 11kB.

So to answer your question: Yes. My first intuition is, that by 
splitting the completion script and loading the sub-scripts dynamically, 
it will improve in terms of speed and overall memory footprint, at least 
for the average user that does not fire up all possible git commands.

-- 
Regards

Florian

  reply	other threads:[~2018-04-09 19:50 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-08 18:26 [RFC PATCH 0/1] completion: Dynamic completion loading Florian Gamböck
2018-04-08 18:26 ` [RFC PATCH 1/1] completion: Load completion file for external subcommand Florian Gamböck
2018-04-08 18:29   ` Florian Gamböck
2018-04-09 18:26   ` Stefan Beller
2018-04-09 18:26     ` Stefan Beller
2018-04-09 19:49     ` Florian Gamböck [this message]
2018-04-19 14:12       ` SZEDER Gábor
2018-04-08 18:26 ` [RFC PATCH 1/1] completion: load " Florian Gamböck
2018-04-08 22:59   ` Junio C Hamano
2018-04-09  7:29     ` Florian Gamböck
2018-04-09  9:36       ` Junio C Hamano
2018-04-09 13:36         ` Florian Gamböck
2018-04-09 22:06           ` Junio C Hamano
2018-04-10  9:37             ` Florian Gamböck

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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=20180409194955.GA22994@furore \
    --to=ml@floga.de \
    --cc=git@vger.kernel.org \
    --cc=sbeller@google.com \
    --cc=szeder.dev@gmail.com \
    /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 public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).