Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

$<TAB> completing variables which fuzzily-match the word "history" is slow #6288

Closed
zx8 opened this issue Nov 5, 2019 · 3 comments
Closed
Labels
bug Something that's not working as intended completions
Milestone

Comments

@zx8
Copy link

zx8 commented Nov 5, 2019

Using 4f1fa95

I have around ~1100 environment variables exported in both bash and fish (not manually! various scripts automatically export them e.g. https://github.com/techwizrd/fishmarks). Fish is significantly slower than bash.

Pretty simple to repro:

  • In fish, $<TAB> takes ~3-5 seconds
    • Note – complete -C '$' is instant
  • In bash, $<TAB> is instant.

What's going on? I suspect it's the fact that <TAB> is filling in the description as well, while fish's complete / bash don't deal with descriptions. If that's the case I suppose there's not too much we can do about speeding it up?


Edit: Figured it out...

#6288 (comment) Tab-completion of variables which fuzzily-match the word history are significantly slower than other tab-completions.

@zx8 zx8 changed the title echo $<TAB> is significantly slower in fish than bash $<TAB> is significantly slower in fish than bash Nov 5, 2019
@zx8
Copy link
Author

zx8 commented Nov 5, 2019

Interesting, I went through the alphabet one by one typing $[A-F]<TAB> and all completions were instant until I reached $H<TAB> – it took ~2-3 seconds to complete and the only completions I got were:

$HOME  (Variable: /Users/zx8)
$HOMEBREW_NO_ANALYTICS  (Variable: 1)
$HOMEBREW_NO_INSTALL_CLEANUP  (Variable: 1)

What's special about $H<TAB>?


Edit : A bunch of others are slow too... $I, $O, $R, $Y

Edit2 : Haha, I think I see a pattern here – all the letters in the word HISTORY are slow 😂, regardless of case (i.e. $h and $H are equally slow.)


Summary: Tab-completion of variables which fuzzily-match the word history are significantly slower than other tab-completions.

@zx8 zx8 changed the title $<TAB> is significantly slower in fish than bash $<TAB> completing variables which fuzzily-match the word "history" are very slow Nov 5, 2019
@zx8 zx8 changed the title $<TAB> completing variables which fuzzily-match the word "history" are very slow $<TAB> completing variables which fuzzily-match the word "history" is slow Nov 5, 2019
@krobelus krobelus added bug Something that's not working as intended completions labels Nov 5, 2019
@krobelus krobelus added this to the fish 3.1.0 milestone Nov 5, 2019
@krobelus
Copy link
Member

krobelus commented Nov 5, 2019

Should work fine now, that's a hefty speedup 😅

@zx8
Copy link
Author

zx8 commented Nov 5, 2019

Confirmed.

Your recent contributions to fish have been incredibly useful to me @krobelus – thanks a lot! 😃

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 16, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something that's not working as intended completions
Projects
None yet
Development

No branches or pull requests

2 participants