Skip to content

Several speed and aliases improvements#20

Open
bfontaine wants to merge 5 commits intopaulmars:masterfrom
bfontaine:aliases
Open

Several speed and aliases improvements#20
bfontaine wants to merge 5 commits intopaulmars:masterfrom
bfontaine:aliases

Conversation

@bfontaine
Copy link
Copy Markdown
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
Copy Markdown
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