Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upEliminate synchronous I/O on main thread when displaying match results from fuzzy-native #384
Conversation
Co-Authored-By: Rafael Oleza <rafeca@users.noreply.github.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
nathansobo commentedMay 2, 2019
Description of the Change
Previously, limitations in the
fuzzy-nativeAPI required us to callfs.existsSyncon the main thread in order to map the relative paths in match results back into absolute paths in the presence of multiple project roots. This could block the main thread for an arbitrary amount of time and lead to performance degradation, so we decided to fix it.The fix involved changing
fuzzy-native's API to associate each match candidate with an integer identifier. Currently, we're just assigning each item's id to its index in the items array. Now, when we get a match back fromfuzzy-native, we can map it back to the original item that produced the candidate via the match's id. This removes the need for synchronous I/O to disambiguate the relative path.Alternate Designs
I'd love to replace fuzzy-native entirely, but that's out of scope right now.
Benefits
fuzzy-nativeis much simpler.Possible Drawbacks
fuzzy-nativehas diverged even further from the upstream repository, but my understanding is that it is mostly unmaintained anyway.Applicable Issues
#383
#382
atom/fuzzy-native#3