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

Several speed and aliases improvements #20

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

bfontaine
Copy link
Contributor

Features in this PR:

  • faster code: the ~/.aliases.cache file is now loaded only once instead of once per command. I also simplified some parts of the code and cached a few things to make it faster.
  • automatic aliases discovery for Bash and Zsh: no ~/.aliases.cache? That’s not a problem anymore.
  • no special chars in the suggestions: Huffshell shoudn’t suggest you to use a&b for an alias because Bash interprets it as a & b.
  • don’t suggest existing aliases (Recognize when aliases are already being used #3): if g is already aliased to git, Huffshell won’t suggest you.

Feel free to ask any question about the changes here.

@bfontaine
Copy link
Contributor Author

On my machine with no ~/.aliases.cache file and 12787 commands in my history the current huffshell takes ~2.3 seconds while with this PR it takes ~1.4 seconds. If the ~/.aliases.cache file exists the current huffshell takes ~0.5 seconds while with this PR it takes ~0.3 seconds.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant