Hello. I faced some completion performance issue, and I ended up tracking down a performance issue in cmp/source.lua.
The loop in question loops over all completion entries to perform filtering, so it is quite a tight loop. However, it yields to the event loop after every iteration. I think it results in too many context switches, slowing down the code.
Sorry that I don't have a good repro for this, by FWIW, in my own case making this change improves latency observably, when using the cmp-buffer source with a large number of words.
Hello. I faced some completion performance issue, and I ended up tracking down a performance issue in
cmp/source.lua
.The loop in question loops over all completion entries to perform filtering, so it is quite a tight loop. However, it yields to the event loop after every iteration. I think it results in too many context switches, slowing down the code.
Sorry that I don't have a good repro for this, by FWIW, in my own case making this change improves latency observably, when using the cmp-buffer source with a large number of words.