Fork me on GitHub
#lsp
<
2023-09-27
>
borkdude12:09:19

@ericdallo Just found a way to improve performance in babashka with 3x for loops: https://github.com/babashka/babashka/commit/c04b83811c26aaffcd707f2e4b06ad017393127b It uses pgo in the Oracle GraalVM. Could be interesting for clojure-lsp (and clj-kondo binary) too.

ericdallo12:09:12

that looks promising! how did you test the perf improv?

borkdude12:09:59

by running the same example in the old binary and compare it to the new binary

borkdude12:09:10

The idea is to instrument the binary using a typical workload and then use that profile to compile an optimized binary

ericdallo12:09:01

cool, will try with clojure-lsp, we can test with kondo too

ericdallo12:09:21

where did you find about that? some graal post?

ericdallo12:09:16

nice, will take a look, curious to check how much could affect lsp or kondo

ericdallo20:10:09

@U04V15CAJ how did you get the PGO for bb, did you buy or something graalvm enterprise to get that?

borkdude20:10:40

No, use Oracle GraalVM 21 instead of CE

ericdallo20:10:04

ah so it should work for graal 21 already? nice

borkdude20:10:23

yes, but not the CE version

borkdude20:10:08

There is no longer an EE version, it's now just called Oracle GraalVM and it's free to use

ericdallo20:10:21

yeah, just realized that, awesome!

ericdallo22:10:52

Still doing some tests but aparrently, 15s to lint clojure-lsp project without cache and 10s with pgo 👀 the binary size went from 89M -> 94M but seems to be worth it

ericdallo22:10:30

On Nubank biggest project with cache 52s / 38s which is amazing

borkdude06:10:02

Weird, bb went from 80 to 65 mb. How did you create the iprof file?

ericdallo11:10:44

I could not create it using in an editor since the iprof is only generated after the program exit with status 0, but I used clojure-lsp diagnostics which does almost the same things that does in the editor

ericdallo11:10:08

I could force a exit 0 when using in the editor coding that, but don't think would change that much

👍 1
borkdude13:10:18

@ericdallo I'm reverting PGO in bb for now since the iprof file cannot reliably be re-used over multiple builds it seems

borkdude13:10:28

and I don't want to build twice

ericdallo13:10:55

what you mean build twice?

borkdude13:10:54

well, you have to build once to build the instrumented binary

borkdude13:10:02

which then produces the iprof file

borkdude13:10:09

and then you build the final optimized binary

ericdallo13:10:41

ah, so you would need to add that to CI or something?

ericdallo13:10:01

I see, so if you change bb's code you need to always generate a new iprof

borkdude13:10:12

so far it worked with a shared iprof file

borkdude13:10:18

but when I bumped httpkit, it didn't work anymore

borkdude13:10:43

I did expect it, I was surprised it did work actually initially

ericdallo13:10:52

at least would be a new build for all platforms, not one for each platform

ericdallo13:10:47

so, for clojure-lsp we have 5 builds, which is all platforms we support, that would be 6 then

borkdude13:10:55

well, I tried that, making an iprof locally and share that over other platforms, but it didn't work anymore

ericdallo13:10:17

I'll probably revert as well so

ericdallo13:10:24

tks for the headsup

borkdude13:10:36

how did you do it so far then?

ericdallo13:10:15

I implemented that this last weekend and only tested on my machine 😅 so when I release a new lsp version we would probably face that issue with other people using

borkdude13:10:43

but how did you implement what

borkdude13:10:04

anyway it might still work for lsp, but httpkit maybe does something weird

ericdallo14:10:00

yeah, good point, we already have running for some days on nightly, so I suppose some people would already have complains :thinking_face:

hiredman17:09:54

if you have a defn with out a docstring with a comment above it, the "Suppress 'missing-docstring' diagnostic" code action just indents the defn

😆 1
ericdallo18:09:51

hehe funny bug, I can repro, feel free to open a issue

ericdallo18:09:16

That should happen on any suppress that has a comment above I suppose