scalacenter / bloop

Bloop is a build server and CLI tool to compile, test and run Scala fast from any editor or build tool.

Home Page:https://scalacenter.github.io/bloop/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

unreasonable about of disk writes

silles79 opened this issue · comments

Every time I open a project in vcode, which was previously fully compiled,
i'm getting a very high amount of disk writes:
image

PID: 33049 is Bloop server...

metals log
2022.12.23 13:55:48 INFO time: Connected to build server in 0.61s
2022.12.23 13:55:48 INFO Connected to Build server: Bloop v1.5.6
2022.12.23 13:55:48 INFO time: Imported build in 0.31s
2022.12.23 13:55:57 INFO time: indexed workspace in 8.29s

No recompile happens, but still a lot of disk writes

ok it's a very big project:
du -hs .bloop/
3.7G .bloop/

but why does it have to rewrite 1G?

Thanks for reporting! This is because for each client of Bloop artifacts are copied to a separate directory for that client only, so when Metals in VS Code connects to Bloop it gets a new directory. I am not sure if that is needed really, but that was the architecture choice made a while ago.

We can start a conversation here whether this separate directory is really needed and if it actually causes more issues than it solves.

looks like every bloop-internal-classes folder is copied into bloop-bsp-clients-classes and on exit it's cleared out.

I noticed it while investigating why my brand new SSD already has +400GB written to it.
Data Units Written: 844,391 [432 GB
ouch

as a workaround I linked all bloop-internal-classes folders to a ramdisk:

export RAMDISK=~/ramdisk/bloop-cache for d in 'find . -type d -name bloop-bsp-clients-classes'; do echo mkdir -p $RAMDISK/$d echo rm -rf $d echo ln -s $RAMDISK/$d $d done