-
Notifications
You must be signed in to change notification settings - Fork 54
Description
I'm working on a monorepo with >60 projects and about ~3k files. Using kotlin-lsp is much slower when compared to any other lsp - or intellij for that matter, though not by a large margin.
I ran a JFR and noted quite a few things down that maybe can explain that:
- Threads seem to constantly lock each other, perhaps there's a bottleneck in a
ConcurrentHashMap
- This can also be seen both by the lock wait time (~2s out of a 2 minute recording) and by
ConcurrentHashMap.get
being the highest profiled method.
- This can also be seen both by the lock wait time (~2s out of a 2 minute recording) and by


- There's a humongous number of
NoSuchMethodException
s being thrown by some dynamic dependency not being loaded correctly- Roughly ~100 exceptions per second are being thrown here

- Memory allocation is considerably higher than normal
- OS reports ~19GB of mem usage;
- JFR reports over 100GB of mem usage in the 2 minutes it ran;
- This leads to few long pauses, like the almost 1sec GC pause.



- The unnecessary network roundtrip might just make things more complicated
- I understand the architecture of using a client-server architecture, though I don't fully agree, but at least it could've been simplified to use a unix socket instead of TCP that goes on the public IP address (which I hid for obvious reasons)

This is a surface-level analysis and I'm pretty sure that, by the looks of it, having a deeper look at the code there's more low-hanging fruit to be fixed which can yield a better performance.
Before any backlash, I do want to acknowledge that I believe this is an evolution from what we had before and I'm thankful that there's an officially supported LSP for kotlin now. Also, this is an invitation to to improve and I'm pretty sure not only me but other people in the community would be willing to help test, debug, measure and improve the software. Performance matters, specially when it comes to development experience.
I can provide as much information as necessary and help out in the process of making this run smoother. Thanks in advance for having a look at this.