Closed Hunter-Github closed 6 years ago
You're completely right, thanks for pointing that out. I'm currently on vacations and can't do anything about it. I could accept a pull request, so if you want to improve it yourself go ahead.
Thanks, will have a look.
Any update? ;)
Nope, sorry. Besides, I don't think this snippet is really responsible for any slowdowns. I think it's more likely that this slowdown is caused by the sheer number of auto-complete suggestions that you get when typing a single letter, so your other suggestion would most likely solve this.
Also, if there really is a noticeable difference with a different data structure would of course have to be profiled first.
Since 677bad537b0698301bdbce1d6ca005eef50ffc4d the flat word list is replaced by one level prefix dictionary. The length of the prefixes is controlled by minimal length
settings parameter.
By default (for backward compatibility reasons) this parameter is 1
. But if you want to speed up this plug-in you can change it to 2
, 3
or maybe 4
.
If you combine "minimal length": 3
with "maximum results": 10
in DictionaryAutoComplete.sublime-settings the complexity is highly reduced.
Relevant code:
It is obvious that the simple list structure used here is hugely inefficient. A suffix tree would have much lower lookup complexity and would not drag down the editor - autocompletion feels laggy on less than cutting edge machines and in high load environments.