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

minicli: speed up compilation #1184

Merged
merged 7 commits into from Nov 14, 2018
Merged

Conversation

jcrussell
Copy link
Contributor

Index patterns into a trie-like data structure and then compile commands by walking the trie.

The main idea is to store the handlers in a trie so that we can lookup
the handler for an input quickly.
Use trie-like data structure to store the patterns and compile commands
as we walk it. This is hopefully much faster than the old approach.

Need to fix help still -- it reports a bunch of duplicates.
Able to run commands properly. Initial profiling results look good.
Make sure that we don't show help for the same handler twice.
We no longer set the pattern for compiled commands because we don't
track that info. Update tests to reflect this.

Remove ambiguous command test -- ping and ping6. This should not be
allowed.
@jcrussell jcrussell added this to the 2.6 milestone Oct 24, 2018
@jcrussell
Copy link
Contributor Author

Found a bug, currently doesn't copy minicli flags to subcommands (e.g. preprocess):

namespace foo shell ls file:test

@jcrussell jcrussell assigned jcrussell and unassigned djfritz Nov 13, 2018
Fixes `namespace foo shell ls file:test`.
@jcrussell
Copy link
Contributor Author

And another:

$ namespace foo cc process kill all
2018/11/13 07:35:54 WARN trie.go:180: ambiguous command, found 2 possibilities

namespace foo cc process kill all
2018/11/13 07:35:54 WARN trie.go:180: ambiguous command, found 2 possibilities

Shouldn't be ambiguous since we have one exact match and one prefix
match.
Copy link
Contributor

@djfritz djfritz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@djfritz djfritz merged commit fa3623d into sandia-minimega:master Nov 14, 2018
@jcrussell jcrussell deleted the minicli branch November 14, 2018 22:03
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.

None yet

2 participants