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

Parallel fuzzy filtering #2225

Merged
merged 6 commits into from
Sep 22, 2021
Merged

Parallel fuzzy filtering #2225

merged 6 commits into from
Sep 22, 2021

Conversation

pepeiborra
Copy link
Collaborator

@pepeiborra pepeiborra commented Sep 21, 2021

Following #2215 and #2217 this is another performance improvement to completions driven by the large Sigma codebase.

On every completion attempt we need to match the prefix against all the identifiers in the project, with a cost of O(Identifiers*C) where C is the average number of characters per identifier. This PR parallelises the matching and uses vectors to reduce the amount of allocations and enable in-place sorting of the results.

ghcide/ghcide.cabal Outdated Show resolved Hide resolved
@pepeiborra pepeiborra marked this pull request as ready for review September 21, 2021 20:49
Copy link
Member

@jneira jneira left a comment

Choose a reason for hiding this comment

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

Not sure if there are existing tests which might be changed to cover changes, i let it to your consideration

@pepeiborra
Copy link
Collaborator Author

Not sure if there are existing tests which might be changed to cover changes, i let it to your consideration

All the completions test suite cover these changes

@jneira jneira added the merge me Label to trigger pull request merge label Sep 22, 2021
@pepeiborra pepeiborra removed the merge me Label to trigger pull request merge label Sep 22, 2021
@pepeiborra pepeiborra merged commit 2b9cce5 into master Sep 22, 2021
@pepeiborra pepeiborra deleted the parallel-fuzzy branch September 22, 2021 14:29
pepeiborra added a commit that referenced this pull request Sep 23, 2021
* Revert "Inline Text.Fuzzy to add INLINABLE pragmas (#2215)"

This reverts commit 2869077.

* Fuzz in parallel

* Efficiently with vectors

* use mapMaybe for compat. with older versions

* switch to stable sort

* clean ups
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