The observation is that at beginning of my coding sessions, when I start the compilation like below:
$ rescript clean -with-deps && rescript build -w
>>>> Start compiling
rescript: [46/46] src/resolvers/Resolver.cmj # this is where it freezes
>>>> Finish compiling 90494 mseconds
My machine will freeze for 1-2 minutes. I suspect this might have something to do with a lot of file watchers and a lot of write, but as I cannot reliably reproduce this after these “first compilation daily”, I’m not sure yet what could be the case.
Okay, so I am able to kinda reproduce the issue. It happens after I switch between branches with git
When I run bstracing after running rescript build -w, everything seems to be stretched for the whole duration of the compilation (Wall Duration is approximately the same for every row, or “process”).
When I run bstracing after running rescript build, some processes took much longer. They are stuck at the cmj category.
It’s also not just rescript build that can freeze. Sometimes rescript does not freeze but after that git would freeze when I try to checkout other commits.