[Bash-completion-devel] Bug#764800: spurious function in bash-completion causes >30% performance degradation (and is bug'ed)

Linda A. Walsh bash at tlinx.org
Mon Oct 13 23:09:58 UTC 2014


Ville Skyttä wrote:
> See comments in bash_completion next to the definition of the
> function. Due to its deprecated status it is not likely to be changed
> any more, especially in ways that would change its behavior (e.g. the
> "type -P" case).
>
> The function is not used by bash-completion itself at all,
---
    ??? It takes up 30% of the initialization time.   I'm
confused.  If it isn't being used, how can it take up 1/3rd of the
startup time?


As for -P  -- that makes 'have' do what it was designed to do.  As it
is, it tests for the presence programs based on function and alias
definitions. It's supposed to check for the presence of the programs
in the PATH -- not functions and aliases.  But if you want it to remain
buggy, just change out the function and make the alias = to 'type'.
The use of -P is just to make it correct -- it doesn't affect the
performance improvement.




More information about the Bash-completion-devel mailing list