rescript-lang / rescript-compiler

The compiler for ReScript.
https://rescript-lang.org
Other
6.74k stars 448 forks source link

Compilation can use too much parallelism #4479

Closed bloodyowl closed 4 years ago

bloodyowl commented 4 years ago

On a MacBook, the process sometimes freezes other apps.

bstracing shows 6 parallel processes, and the CPU on my machine has 2 cores and 4 threads.

bobzhang commented 4 years ago

Do you know how much memory is consumed? Is it starved by the usage of CPU or memory

TheSpyder commented 4 years ago

It's definitely CPU. If I change bsconfig.json, vscode becomes basically unusable for the 5 and a half seconds it takes to rebuild everything. I do run a watch process separately to vscode, though, so it's possible there are two copies of bucklescript fighting for CPU (even though I have autoRebuild off).

bobzhang commented 4 years ago

Not relevant to ninja, I found this is a general issue with vscode -- when I run a task in vscode integrated terminal, if it's resource consuming, the editor will get frozen

TheSpyder commented 4 years ago

I run bsb outside of vscode and it still happens - I guess vscode is busy re-indexing files and chewing up the main thread. The rebuild is slightly slower with vscode running.

bloodyowl commented 4 years ago

Same here, I always run bsb from Terminal.app

bobzhang commented 4 years ago

hi @bloodyowl you can use some command line args like this: bsb -- -j 1, let me know if it would work

bobzhang commented 4 years ago

let me know if the flags mentioned above does not work for you