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

Optimize the generation of completion matches #136

Closed
2 tasks done
Jacalz opened this issue Jan 12, 2024 · 1 comment
Closed
2 tasks done

Optimize the generation of completion matches #136

Jacalz opened this issue Jan 12, 2024 · 1 comment
Labels
enhancement New feature or request performance Improve application performance
Milestone

Comments

@Jacalz
Copy link
Owner

Jacalz commented Jan 12, 2024

Checklist

  • I have searched the issue tracker for open issues that relate to the same feature, before opening a new one.
  • This issue only relates to a single feature. I will open new issues for any other features.

Is your feature request related to a problem?

The code in https://github.com/Jacalz/rymdport/blob/main/internal/transport/completion.go is more or less a direct copy of the autocompletion generation found in Wormhole William. It has served us very well but it does allocate a lot of memory and can probably be optimized to be faster. #

Describe the solution you'd like to see.

Try to get rid of unnecessary memory allocations and speed up the algorithm. We might want to drop the strings.Split() allocations and just use a combination string.Index and other lookups. On top of this, we might want to dry to do a binary search in the wordlist to speed up prefix matching.

@Jacalz Jacalz added enhancement New feature or request performance Improve application performance labels Jan 12, 2024
Jacalz added a commit that referenced this issue Jan 13, 2024
@Jacalz Jacalz added this to the v3.6.0 milestone Jan 13, 2024
@Jacalz Jacalz closed this as completed Jan 13, 2024
@Jacalz
Copy link
Owner Author

Jacalz commented Jan 13, 2024

Performance improvement is improved an order of magnitude.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request performance Improve application performance
Projects
None yet
Development

No branches or pull requests

1 participant