Speed up auto-completion when using company#187
Speed up auto-completion when using company#187dvzubarev wants to merge 1 commit intokostafey:masterfrom
Conversation
If the point is on dot (name.| or name.var|) then synchronously collect candidates. Otherwise use cached data. When cache is empty (first time invocation), it returns only common SQL words and schedules the cache update. Delayed cache update is done via run-with-idle-timer. Also cache is updated when it is older than ejc-company-cache-update-ivl-secs (60 by default). It allows to reduce completion time from 0.4 s to 0.0011 for cases like (SE|)
|
Sorry for late respond. I checked this PR, but forgot to reply, until I reviewed my Org tasks, picked up this issue again.
This design is sophisticated and fine for me. I think it's good to be merged. |
|
Hi, @kostafey , Will this commit be merged into the master branch? |
Hello. I was blocked by GitHub (details) for some period of time. Now I'm back. So I'll return all repos links from GitLab to GitHub soon. Regarding this issue. I think we can merge this changes if user will have an option to maintain the previous behavior (e.g. via custom variable). |
I agree. |
This is follow-up of #141
Completions on words feels very slow. You can benchmark it with
following code:
It gives results in range of 0.3 - 0.5 seconds.
Completion time reduces to 0.0011 after this change.
If the point is on dot (name.| or name.var|), then synchronously collect candidates. Otherwise use cached data. When cache is empty (first time invocation), it returns only common SQL words and schedules the cache update. Delayed cache update is done via
run-with-idle-timer. Also cache is updated when it is older thanejc-company-cache-update-ivl-secs(60 by default).Also these changes helps in case of fatal server error (like #155). Company will complete common sql keywords and report the error, instead of just reporting the error.