lsp

:clojure-lsp: Clojure implementation of the Language Server Protocol: https://clojure-lsp.io/
2021-05-13T19:06:03.182800Z

after the last update lsp has become practically unusable, am i the only one with this problem?

practicalli-john 2021-05-14T09:43:40.192900Z

If it helps, I'm using lsp-mode <tel:202105101947|20210510.1947>, on Emacs 27.1, gnu/linux without any performance issues

1
2021-05-14T10:15:14.193100Z

Ok @ericdallo

2021-05-13T19:06:35.182900Z

even adding a comment and saving it causes a freeze

2021-05-13T19:07:14.183100Z

:didChange 10143ms :codeAction 88ms :codeAction 73ms :documentHighlight 4ms :hover 67ms :codeAction 730ms

ericdallo 2021-05-13T19:31:29.183300Z

oh, did-change is spending too much time for some reason

ericdallo 2021-05-13T19:31:43.183500Z

did you notice if is related only with latest version or some older one?

ericdallo 2021-05-13T19:32:22.183700Z

@snoe mentioned a slowness but we didn't find anything relevant yet and I'm not seeing those did-change peaks

2021-05-13T19:35:53.184Z

I updated lsp yesterday, before that it was ok

ericdallo 2021-05-13T19:35:58.184200Z

for curiosity, how many lines your buffer has?

2021-05-13T19:36:18.184400Z

1038

ericdallo 2021-05-13T19:36:27.184600Z

Do you know what version you were using before that?

2021-05-13T19:38:40.184800Z

No, but I should be able to find it soon. I still have the terminal open where I updated, I just need to go ~10000 lines up 🙃

😅 1
2021-05-13T19:40:16.185100Z

aur/clojure-lsp-bin              1:2021.04.27_20.17.45-1 -&gt; 1:2021.05.06_19.44.00-1

snoe 2021-05-13T19:40:38.185300Z

the logs haven't always accurately covered how long the didChange took, so if you might have to time from the client if you start spelunking history

ericdallo 2021-05-13T19:40:58.185500Z

exactly ☝️ 😕

ericdallo 2021-05-13T19:42:08.185700Z

@huxley could you try the <https://github.com/clojure-lsp/clojure-lsp/releases/tag/2021.04.27-20.17.45|2021.04.27-20.17.45> and check if looks smoother for you? (ignoring the didChange time on log as it will be incorect)

2021-05-13T19:43:37.185900Z

sure, as soon as I remember how to downgrade package in arch

ericdallo 2021-05-13T19:45:29.186100Z

@dharrigan maybe knows 🙂

2021-05-13T19:47:43.186300Z

done

2021-05-13T19:48:01.186500Z

I will check already if it is better

ericdallo 2021-05-13T19:49:05.186700Z

Remember that there is the project scan startup time if deps were changed

2021-05-13T19:50:30.186900Z

I restarted lsp, opened the buffer again, waited for it to load and tested in the same place as before and it is much better

snoe 2021-05-13T19:50:58.187100Z

thanks! good to know I'm not crazy 🙂

ericdallo 2021-05-13T19:51:48.187300Z

Nice, so indeed it was `https://github.com/clojure-lsp/clojure-lsp/releases/tag/2021.05.06-19.44.00 that introduced that

2021-05-13T19:51:49.187500Z

I always get all the bugs stuck, so if something doesn't work for someone somewhere, I'm definitely one of those people

😆 1
ericdallo 2021-05-13T19:52:20.187700Z

Maybe this @snoe https://github.com/clojure-lsp/clojure-lsp/commit/857bdc186e5585771c3b50b2c444065fb2b2e018 Still I don't know why

snoe 2021-05-13T19:54:16.188Z

when I watch diagnostics for the old version and new version come they are just coming in faster, so I suspect it's not that, but how much processing anaylze-changes is doing

2021-05-13T19:55:12.188300Z

thanks colleagues for your work, I appreciate it ❤️ , but I have to get back to my

ericdallo 2021-05-13T20:01:40.188500Z

@huxley do you use vim or emacs?

ericdallo 2021-05-13T20:02:18.188700Z

@snoe maybe vim is waiting for did-change for some reason? That change, made did-change only end after changes were analyzed

2021-05-13T20:03:06.188900Z

emacs

1
2021-05-13T20:05:35.189200Z

if I had to guess, although I don't know emacs and elisp, there is a problem with asynchronicity somewhere, because the main thread of emacs is blocked to the point that even the cursor was changing and ctrl-g didn't help

ericdallo 2021-05-13T20:06:37.189400Z

odd, I didn't notice anything on medium/big projects

ericdallo 2021-05-13T20:06:52.189600Z

I suppose there is no easy repro for that right?

2021-05-13T20:10:30.189800Z

It looks like there isn't

2021-05-13T20:13:40.190Z

If there is anything I can do to help, I am happy to do so.

ericdallo 2021-05-13T20:14:43.190200Z

We need to repro the issue to make sure a possible fix would solve that 😕

snoe 2021-05-13T22:25:56.190400Z

@ericdallo no, the client is still responsive but the diagnostics update like 1 letter at a time since thats being sent from clojure-lsp. a good project to repro this stuff is editing clojure core repo code. core.clj by itself to start and make sure did-change there is relatively fast.

ericdallo 2021-05-13T22:33:02.190600Z

@snoe I tested on clojure.core and indeed took 28s of freezed emacs after changing a single char 😱

ericdallo 2021-05-13T22:33:49.190800Z

So I imagine the didChange change on latest version caused that?

ericdallo 2021-05-13T22:44:17.191Z

Yeah, the previous release is way faster for some reason

ericdallo 2021-05-13T22:45:43.191200Z

Oh it's faster but it still take a long time to update lsp things like diagnostics document highlight

ericdallo 2021-05-13T22:45:55.191400Z

but it's better then freezing buffer

ericdallo 2021-05-13T22:47:58.191600Z

Alright, we need to rollback that, but then we will face the issue I solved with that commit, concurrency on other methods while didChange didn't update the file :document with the changes

ericdallo 2021-05-13T22:48:53.191800Z

We probably can do sync the file change computation but leave kondo run to async, that probably would be the best approach, WDYT @snoe?

ericdallo 2021-05-13T22:51:11.192100Z

yeah, the 28s is related with kondo run, the file change computation is really fast

ericdallo 2021-05-13T22:51:45.192300Z

Alright, I'll try to make a fix that will fix both issues 🙂