Closed orschiro closed 11 years ago
Well, source
'ing should be almost instantaneous, the slow part is actually replacing the completion specs. I'm guessing you're using the "recommended" function, fuzzy_replace_filedir_xspec
, to set up completion? That guy is slow... _fuzzy_replace_compspecs_by_function
appears to be the real culprit, although I haven't dug in any further than that...
After some brief testing it looks like we might be able to throw in a grep
or two to avoid doing so much regex matching inside those while
loops... I'll have a look.
Pushed a fix. Thanks for prodding me to finally fix this :).
Thanks! Indeed I was using fuzzy_replace_filedir_xspec
. I updated your script but also commented out fuzzy_replace_filedir_xspec
and now use fuzzy_setup_for_command cd
and fuzzy_setup_for_command rm
to set up only the completions I really need.
Now opening a terminal does not show any delay anymore. :+1:
Awesome. By the way, fuzzy_replace_filedir_xspec
should be fast now too.
@mgalgs
Depends on how you define fast, I guess.
See the following screencast. The first terminal session uses specific fuzzy_setup_for_command rm
and fuzzy_setup_for_command cd
in bashrc
. The second session uses fuzzy_replace_filedir_xspec
.
http://videobin.org/+718/8y5.html
But never mind, it's a minor issue I can live with.
Hmm, from the screencast I couldn't tell how long it was actually spending in fuzzy_replace_filedir_xspec
... Can you just run that function from your terminal? On my machine it only takes about .3 seconds to run:
[mitchelh@mitchelh-linux ~]$ fuzzy_restore_all_specs >/dev/null
[mitchelh@mitchelh-linux ~]$ time fuzzy_replace_filedir_xspec
real 0m0.297s
user 0m0.020s
sys 0m0.033s
[mitchelh@mitchelh-linux ~]$
~ $ fuzzy_restore_all_specs >/dev/null
~ $ time fuzzy_replace_filedir_xspec
real 0m0.575s
user 0m0.043s
sys 0m0.053s
~ $
Would you say this is significantly too much time or simply a fact of my "old" Thinkpad X200T?
Half a second looks about right. On Nov 8, 2013 6:20 AM, "Robert Orzanna" notifications@github.com wrote:
~ $ fuzzy_restore_all_specs >/dev/null
~ $ time fuzzy_replace_filedir_xspec
real 0m0.575s user 0m0.043s sys 0m0.053s
~ $
Would you say this is significantly too much time or simply a fact of my "old" Thinkpad X200T?
— Reply to this email directly or view it on GitHubhttps://github.com/mgalgs/fuzzy_bash_completion/issues/4#issuecomment-28065452 .
Thanks for your support. I consider this as finally resolved. :)
Hi there,
First of all, thanks for this excellent piece of software. I was looking for an easy tab completion for quite a while!
I added
source ~/.fuzzy_bash_completion
to.bashrc
. However, since then I notice a very slow startup of my interactive shell. It takes around ~3 seconds until the prompt is shown.Is this normal and can this somehow be improved?
Thanks!