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

Avoid lagging for edge cases while suggesting #45

Open
dimztimz opened this issue Feb 5, 2020 · 2 comments
Open

Avoid lagging for edge cases while suggesting #45

dimztimz opened this issue Feb 5, 2020 · 2 comments
Milestone

Comments

@dimztimz
Copy link
Contributor

dimztimz commented Feb 5, 2020

Hunspell uses 3 techniques.

  1. Add time limits in the slow algorithms (O(n^2) or more). Hunspell uses this in only 3 of all 12 algorithms. It does the time check only after it checks 100 candidates. If the time limit was exceeded, it stops, otherwise it goes on for another 100 attempts and checks the time limit again and so on.
  2. Firstly, check the candidates of all 12 algorithms only as simple words, and only if there are no suggestions, rerun the same algorithms checking the candidates as compounds. This shuffling speeds up the case when there are suggestions, but it does not speed up the case when there are not any suggestions.
  3. Limit the number of suggestions. Hunspell has a hard limit to 15 suggestions. From my experience this condition is very rarely hit, so it is the least effective. It is probably for some pathological cases.
@PanderMusubi PanderMusubi self-assigned this Apr 9, 2020
@PanderMusubi PanderMusubi self-assigned this Aug 4, 2020
@dimztimz dimztimz mentioned this issue Sep 26, 2020
@dimztimz dimztimz added this to the Version 5 milestone Dec 7, 2020
dimztimz added a commit that referenced this issue Jun 9, 2021
This basically solves issue #45. There are some more improvements that can
be made as described in the issue text, but those additional improvements
will be in the range of milliseconds.
@dimztimz
Copy link
Contributor Author

dimztimz commented Jun 9, 2021

I think this is almost solved with commit 8558564, anything more can be done in a future version.

@dimztimz dimztimz modified the milestones: Version 5, Version 6 Jun 9, 2021
@dimztimz
Copy link
Contributor Author

Major improvements with cb3e4c5.

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

No branches or pull requests

2 participants