bash_completion...
Now I've been in love with the
bash_completion package for a couple years now. I've always wondered about how much performance hit does it cause, by loading all the completion rules for all commands known to it in every bash shell, which is default shell in any decent Linux system, every single time... But never measured before.
Tonight, I'm writing a shell script (will post soon), and I was wondering why does it take 0.66s for it to print out usage information. Indeed it was bash_completion. First disable it, time down to 0.09s. Neat. But then I simply added a single magic line to /etc/profile.d/bash_completion.sh:
[ -z "$PS1" ] && return
so it doesn't run in non-interactive shells. That's it!