sebastiencs / company-box

A company front-end with icons
565 stars 64 forks source link

Company box extremely slow with java jdtls lsp #136

Closed jacksonludwig closed 4 years ago

jacksonludwig commented 4 years ago

I believe company-box is causing huge slowdowns when the completion options are shown when I use the java jdtls server. I haven't noticed this much with other servers.

Holding scroll up or down causes visible lag/stutter, which also occurs when typing as completions pop up for the first time.

Here is a profile I took a little while back showing how much of a hog company box is in these cases, in which I simply scroll up and down the completion list while using the jdtls server: image

I am aware in the image I was using an older version, but the same performance hitches occur with the most recent commits, even if the function names are different.

sebastiencs commented 4 years ago

@ludwj61 The implementation of company-box has changed quite a lot lately and the report is with an old version. The functions it highlight no longer exist, could you profile with the last version ?

Can you try to set company-box-doc-enable to nil ? See if it still occurs

jacksonludwig commented 4 years ago

@sebastiencs Thanks for the reply. After updating to the latest version I still get the same stutter, however it does seem to happen a bit less frequently. image

When setting doc to nil, though, the stutter goes away completely: image

So since it seems that the cause is the doc preview, is there any way to improve it's performance?

jacksonludwig commented 4 years ago

Interestingly, I just tried my same config on a ubuntu VM and the lag doesn't occur. This occurs on my arch machine and my manjaro machine.

sebastiencs commented 4 years ago

@ludwj61 Does https://github.com/sebastiencs/company-box/commit/914fefd391f183672ca5eb1a49cabab3aa5736d2 fix your issue ? It seems that your server, java jdtls, is slow to return the documentation. The solution would be to keep company-box-doc-enable to nil and manually call company-box-doc-manually, by binding it to a key.

How big is the documentation ?

jacksonludwig commented 4 years ago

914fefd fixes it! From what I tested so far it just seems to be working and there's no need to call the doc manually either.

Also, the docs themselves are usually very small with jdtls.

Thanks!