Skip to content

[Options] Use a prefix trie for argument matching #1

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

Merged
merged 3 commits into from
Oct 10, 2019

Conversation

harlanhaskins
Copy link
Contributor

Instead of searching the whole list for the longest matching option,
build up a prefix trie and search that.

For a stress test that passes 500,000 -D flags, this and the changes to lookup for parsed options takes the total
time from 40 seconds to 1.6 seconds on my local machine.

This is otherwise NFC

Harlan Haskins added 3 commits October 10, 2019 09:10
This changes the behavior for several uses of ParsedOptions to go
through lookup tables from canonical option spellings to the list of
matched parsed options, in order.
@DougGregor DougGregor merged commit 6411e96 into master Oct 10, 2019
@aciidgh aciidgh deleted the if-at-first-youre-o_n-trie-trie-again branch October 10, 2019 21:50
DougGregor pushed a commit that referenced this pull request Oct 18, 2019
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.

2 participants