[Bash-completion-devel] After adding bash-completion to .bashrc loading prompt is slow

David Paleino dapal at debian.org
Tue Apr 5 06:36:39 UTC 2011


On Sun, 03 Apr 2011 15:20:21 +0300, Ville Skyttä wrote:

> [..]

~ $ sudo sync; echo 3 | sudo tee /proc/sys/vm/drop_caches; hash -r;
time . /deb/git/upstream/bash-completion/bash_completion

real	0m10.734s
user	0m0.752s
sys	0m0.224s
~ $

After disabling the loading from /etc/bash_completion.d/, I have:

real	0m3.339s
user	0m0.324s
sys	0m0.060s

I'm suspecting some third party completion (i.e. not provided by us) is taking
the other 7 seconds there :)
Still, 3s is quite huge, but it's still with the 188 completions we have in
the repository.

The latest fixes by Ville, while theoretically, didn't give me a speed-up (at
all, but I tried only once, thus I suspect it's more-or-less the same):

~ $ sudo sync; echo 3 | sudo tee /proc/sys/vm/drop_caches; hash -r;
time . /deb/git/upstream/bash-completion/bash_completion 3

real	0m4.638s
user	0m0.312s
sys	0m0.040s
~ $

I'll check which third-party completion is being so slow for me (and eventually
report bugs where appropriate).

While we should really fix this upstream (can't tell how though), from a
downstream point of view, sure, we can just load the completions needed. For
Debian-based systems I'm thinking at some post-installation hook, which checks
what's been installed in $PATH, and makes appropriate links to $BASH_COMP_DIR.
I'll need to think this better though.

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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/bash-completion-devel/attachments/20110405/00677ba1/attachment.pgp>


More information about the Bash-completion-devel mailing list