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.
Checklist
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 combinationstring.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.