-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Provide a faster implementation of Fuzzy Searching for 'Add Using'. #7390
Provide a faster implementation of Fuzzy Searching for 'Add Using'. #7390
Conversation
Tagging @dpoeschl |
var currentNode = _builderNodes[currentNodeIndex]; | ||
|
||
var editDistance = EditDistance.GetEditDistance(currentNode.LowerCaseCharacters, lowerCaseCharacters); | ||
// This shoudl never happen. We dedupe all items before proceeding to the 'Add' step. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should
83757ce
to
aad4ebd
Compare
// of children along with each node. However, this would be very inefficient and would | ||
// put an enormous amount of memory pressure on the system. | ||
// | ||
// Imperical data for a nice large assembly like mscorlib gives us the following |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Empirical
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is in Utilities, so you should probably add more context here, that you added all names in mscorlib and got this distribution.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup yup.
18056eb
to
16aca85
Compare
Linux failure due to #7411. |
switch (kind) | ||
{ | ||
case SearchKind.Exact: | ||
_predicate = s => StringComparer.Ordinal.Equals(name, s); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cache this statically?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't. It captures the parameter to the outer method.
retest this please |
a36050d
to
8a88586
Compare
test vsi please |
1ccf2b3
to
da98648
Compare
test vsi please |
1 similar comment
test vsi please |
// y |∞ 8 * | ||
// | ||
// And then consider a point above that diagonal (indicated by x). In the example | ||
// above, the edit distance to * from + will be (x+4). If, for example, threshold |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From +
?
47605ca
to
eac1ed2
Compare
Provide a faster implementation of Fuzzy Searching for 'Add Using'.
@CyrusNajmabadi Does the BKTree creation only happen when you first ctrl+dot in a way that triggers add using? Or is it done earlier than that, on idle or something? I think we said the other day that it won't be done earlier due to some bug -- is something tracking that? |
The BKTrees will currently happen when asked for for ctrl-dot (or if we're trying to decide if we should show the lightbulb or not). There is nothing tracking any work to make the index construction happen any sooner than it already did before the addition of these trees. |
This change refactors things to move fuzzy searching to a BK-tree implementatoin. The BK tree helps reduce the number of of dictionary checks we have to do by about 90%.