Debian Bug report logs - #467231
bash_completion is big and loads slowly; load-by-need proposed

version graph

Package: bash-completion; Maintainer for bash-completion is Bash Completion Maintainers <bash-completion-devel@lists.alioth.debian.org>; Source for bash-completion is src:bash-completion.

Reported by: Andrei Paskevich <andrei@capet.iut-fbleau.fr>

Date: Sat, 23 Feb 2008 23:45:02 UTC

Severity: wishlist

Tags: confirmed, patch, upstream

Found in version bash-completion/20080705

Fixed in version 1:1.99-1

Done: David Paleino <dapal@debian.org>

Bug is archived. No further changes may be made.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, Matthias Klose <doko@debian.org>:
Bug#467231; Package bash. Full text and rfc822 format available.

Acknowledgement sent to Andrei Paskevich <andrei@capet.iut-fbleau.fr>:
New Bug report received and forwarded. Copy sent to Matthias Klose <doko@debian.org>. Full text and rfc822 format available.

Message #5 received at submit@bugs.debian.org (full text, mbox):

From: Andrei Paskevich <andrei@capet.iut-fbleau.fr>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: bash_completion is big and loads slowly; load-by-need proposed
Date: Sun, 24 Feb 2008 01:43:21 +0200
[Message part 1 (text/plain, inline)]
Package: bash
Version: 3.1dfsg-9
Severity: wishlist


The default /etc/bash_completion in Debian/sid takes 216kb, and 
a couple of scripts in /etc/bash_completion.d add another 100kb.
To load this, my system needs half a second, a perceivable and
quite annoying delay on every shell start. 

I wrote a simple script, that automatically moves the completion
functions from /etc/bash_completion and /etc/bash_completion.d 
to a separate directory and creates a drop-in replacement for 
/etc/bash_completion - which will load any of those completion
functions when it is requested for the first time. By this, we
greatly reduce the loading time (the replacement script is ~30kb)
and also the memory footprint (as we rarely need every completion 
function in every bash session).

The generator script is intended to be run once the base script
/etc/bash_completion is installed and then, every time something 
is added to /etc/bash_completion.d. I'd like to propose it for
the bash package -- maybe as an optional part of installation.

The generator script is attached, any comments are welcome.

-- System Information:
Debian Release: lenny/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing')
Architecture: i386 (i686)

Kernel: Linux 2.6.24-1-686 (SMP w/1 CPU core)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages bash depends on:
ii  base-files                4.0.2          Debian base system miscellaneous f
ii  debianutils               2.28.3         Miscellaneous utilities specific t
ii  libc6                     2.7-8          GNU C Library: Shared libraries
ii  libncurses5               5.6+20080203-1 Shared libraries for terminal hand

Versions of packages bash recommends:
pn  bash-completion               <none>     (no description available)

-- no debconf information
[dyncomp.sh (text/plain, attachment)]

Bug reassigned from package `bash' to `bash-completion'. Request was from Luk Claes <luk@debian.org> to control@bugs.debian.org. (Sun, 02 Mar 2008 15:42:05 GMT) Full text and rfc822 format available.

Tags added: confirmed, patch Request was from David Paleino <d.paleino@gmail.com> to control@bugs.debian.org. (Sun, 11 May 2008 16:54:15 GMT) Full text and rfc822 format available.

Information forwarded to debian-bugs-dist@lists.debian.org, Bash Completion Maintainers <bash-completion-devel@lists.alioth.debian.org>:
Bug#467231; Package bash-completion. (Thu, 22 Jul 2010 02:15:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Francis Irving <francis@flourish.org>:
Extra info received and forwarded to list. Copy sent to Bash Completion Maintainers <bash-completion-devel@lists.alioth.debian.org>. (Thu, 22 Jul 2010 02:15:02 GMT) Full text and rfc822 format available.

Message #14 received at 467231@bugs.debian.org (full text, mbox):

From: Francis Irving <francis@flourish.org>
To: 467231@bugs.debian.org
Subject: This is fantastic
Date: Thu, 22 Jul 2010 02:14:22 +0100
Just to say, this dynamic completino patch is fantastic.

It's lovely having new terminal windows open instantly, and
bash completion still seems to work just as well as ever.

I'd like to see this in the core bash package.




Information forwarded to debian-bugs-dist@lists.debian.org, Bash Completion Maintainers <bash-completion-devel@lists.alioth.debian.org>:
Bug#467231; Package bash-completion. (Thu, 22 Jul 2010 20:34:18 GMT) Full text and rfc822 format available.

Acknowledgement sent to Reuben Thomas <rrt@sc3d.org>:
Extra info received and forwarded to list. Copy sent to Bash Completion Maintainers <bash-completion-devel@lists.alioth.debian.org>. (Thu, 22 Jul 2010 20:34:18 GMT) Full text and rfc822 format available.

Message #19 received at 467231@bugs.debian.org (full text, mbox):

From: Reuben Thomas <rrt@sc3d.org>
To: Debian Bug Tracking System <467231@bugs.debian.org>
Subject: bash-completion: Is there some problem using this patch?
Date: Thu, 22 Jul 2010 21:28:44 +0100
Package: bash-completion
Version: 20080705
Followup-For: Bug #467231

As far as I can see, the only additional programming needed to make
this patch usable is to have a bash-completion hook that can run the
dynamic update script whenever a package that supplies completions is
installed or removed. Is help needed with this? It would be great to
see this in Debian, as can confirm, having been pointed to it by
Francis earlier today, that it does indeed give a significant speedup,
and removes an annoying delay with opening a new terminal window or
tab.

-- System Information:
Debian Release: 5.0.5
  APT prefers stable
  APT policy: (500, 'stable')
Architecture: i386 (i686)

Kernel: Linux 2.6.26-2-686 (SMP w/1 CPU core)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages bash-completion depends on:
ii  bash                          3.2-4      The GNU Bourne Again SHell

bash-completion recommends no packages.

bash-completion suggests no packages.

-- no debconf information




Information forwarded to debian-bugs-dist@lists.debian.org, Bash Completion Maintainers <bash-completion-devel@lists.alioth.debian.org>:
Bug#467231; Package bash-completion. (Thu, 22 Jul 2010 21:18:06 GMT) Full text and rfc822 format available.

Acknowledgement sent to dapal@debian.org:
Extra info received and forwarded to list. Copy sent to Bash Completion Maintainers <bash-completion-devel@lists.alioth.debian.org>. (Thu, 22 Jul 2010 21:18:06 GMT) Full text and rfc822 format available.

Message #24 received at 467231@bugs.debian.org (full text, mbox):

From: David Paleino <dapal@debian.org>
To: Reuben Thomas <rrt@sc3d.org>
Cc: 467231@bugs.debian.org, Freddy Vulto <fvulto@gmail.com>, Francis Irving <francis@flourish.org>, 467231-submitter@bugs.debian.org
Subject: Re: [Bash-completion-devel] Bug#467231: bash-completion: Is there some problem using this patch?
Date: Thu, 22 Jul 2010 23:13:29 +0200
[Message part 1 (text/plain, inline)]
On Thu, 22 Jul 2010 21:28:44 +0100, Reuben Thomas wrote:

> As far as I can see, the only additional programming needed to make
> this patch usable is to have a bash-completion hook that can run the
> dynamic update script whenever a package that supplies completions is
> installed or removed. Is help needed with this?

No, thanks :)
The problem is not the hook (this is really distro-specific), but not diverging
from upstream.

> It would be great to see this in Debian, as can confirm, having been pointed
> to it by Francis earlier today, that it does indeed give a significant
> speedup, and removes an annoying delay with opening a new terminal window or
> tab.

We (upstream) are planning dynamic completion for bash-completion 3.0 [0].
I think this will be done mainly by Freddy Vulto (upstream of
bash-completion-lib), and, AFAICS, it's a different approach from the one
proposed in this bugreport. However, I'm CCing Freddy to hear his opinion --
he surely has a deeper insight on the issue than me.

Kindly,
David

[0]: http://wiki.debian.org/Teams/BashCompletion/Proposals/Roadmap


-- 
 . ''`.   Debian developer | http://wiki.debian.org/DavidPaleino
 : :'  : Linuxer #334216 --|-- http://www.hanskalabs.net/
 `. `'`  GPG: 1392B174 ----|---- http://deb.li/dapal
   `-   2BAB C625 4E66 E7B8 450A C3E1 E6AA 9017 1392 B174
[signature.asc (application/pgp-signature, attachment)]

Message sent on to Andrei Paskevich <andrei@capet.iut-fbleau.fr>:
Bug#467231. (Thu, 22 Jul 2010 21:18:10 GMT) Full text and rfc822 format available.

Information forwarded to debian-bugs-dist@lists.debian.org, Bash Completion Maintainers <bash-completion-devel@lists.alioth.debian.org>:
Bug#467231; Package bash-completion. (Mon, 02 Aug 2010 13:25:26 GMT) Full text and rfc822 format available.

Acknowledgement sent to Reuben Thomas <rrt@sc3d.org>:
Extra info received and forwarded to list. Copy sent to Bash Completion Maintainers <bash-completion-devel@lists.alioth.debian.org>. (Mon, 02 Aug 2010 13:25:26 GMT) Full text and rfc822 format available.

Message #32 received at 467231@bugs.debian.org (full text, mbox):

From: Reuben Thomas <rrt@sc3d.org>
To: 467231 <467231@bugs.debian.org>
Subject: Problem with dynamic completion
Date: Mon, 2 Aug 2010 14:15:46 +0100
For some reason, dynamic completion seems to stop completion of
filenames containing spaces from working. As far as I can see,
everything is correct: this completion is performed by _filedir(),
_filedir's definition has been loaded into my session (according to
the output of "set") etc. But, pressing Tab on a partly-written
filename containing a space only works until I have typed the first
(escaped) space; after that, it doesn't. Reverting to non-dynamically
loaded completions makes everything work. My dynamic completion files
in /etc/bash_dyncompletion.d are up to date.

-- 
http://rrt.sc3d.org




Information forwarded to debian-bugs-dist@lists.debian.org, Bash Completion Maintainers <bash-completion-devel@lists.alioth.debian.org>:
Bug#467231; Package bash-completion. (Wed, 09 Mar 2011 22:18:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to "dpc@ucore.info" <dpc@ucore.info>:
Extra info received and forwarded to list. Copy sent to Bash Completion Maintainers <bash-completion-devel@lists.alioth.debian.org>. (Wed, 09 Mar 2011 22:18:03 GMT) Full text and rfc822 format available.

Message #37 received at 467231@bugs.debian.org (full text, mbox):

From: "dpc@ucore.info" <dpc@ucore.info>
To: 467231@bugs.debian.org
Subject: Solution proposal.
Date: Wed, 9 Mar 2011 23:14:30 +0100
If anybody is interested -- I think I've hacked some nice solution for
this. Seems to be working for me.

http://ucore.info/en/2011/03/faster-bash-completion-loading/
https://github.com/dpc/bash_completion


dpc@mutex:~$ time . /etc/bash_completion.orig
real 0m0.614s
user 0m0.360s
sys 0m0.120s
dpc@mutex:~$ time . /etc/bash_completion.new
real 0m0.168s
user 0m0.120s
sys 0m0.010s




Added tag(s) upstream. Request was from Jonathan Nieder <jrnieder@gmail.com> to control@bugs.debian.org. (Mon, 14 May 2012 03:21:03 GMT) Full text and rfc822 format available.

Reply sent to dapal@debian.org:
You have taken responsibility. (Tue, 15 May 2012 10:12:19 GMT) Full text and rfc822 format available.

Notification sent to Andrei Paskevich <andrei@capet.iut-fbleau.fr>:
Bug acknowledged by developer. (Tue, 15 May 2012 10:12:24 GMT) Full text and rfc822 format available.

Message #44 received at 467231-done@bugs.debian.org (full text, mbox):

From: David Paleino <dapal@debian.org>
To: 467231-done@bugs.debian.org
Subject: Fixed with 1.99
Date: Tue, 15 May 2012 12:10:01 +0200
[Message part 1 (text/plain, inline)]
Version: 1:1.99-1

1.99 is a pre-release of what will be 2.0. This version already features
dynamic completion loading, I'm thus closing this bug.

Kindly,
David

-- 
 . ''`.   Debian developer | http://wiki.debian.org/DavidPaleino
 : :'  : Linuxer #334216 --|-- http://www.hanskalabs.net/
 `. `'`  GPG: 1392B174 ----|---- http://deb.li/dapal
   `-   2BAB C625 4E66 E7B8 450A C3E1 E6AA 9017 1392 B174
[signature.asc (application/pgp-signature, attachment)]

Bug archived. Request was from Debbugs Internal Request <owner@bugs.debian.org> to internal_control@bugs.debian.org. (Wed, 13 Jun 2012 07:37:18 GMT) Full text and rfc822 format available.

Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Mon Apr 21 03:20:56 2014; Machine Name: buxtehude.debian.org

Debian Bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.