MSYS2-packages icon indicating copy to clipboard operation
MSYS2-packages copied to clipboard

It runs slowly with low CPU utilization.

Open DYHrich opened this issue 6 months ago • 6 comments

When opening the ucrt64 shell, there is always a delay. Additionally, when using the cmake and make commands, the CPU utilization is only around 15%.

DYHrich avatar Aug 27 '25 08:08 DYHrich

make does not run in parallel by default, either use ninja or make -j <number of processes>.

oltolm avatar Aug 27 '25 18:08 oltolm

make does not run in parallel by default, either use ninja or make -j <number of processes>.

I use the parallel commend. I think it's not the key reason. When you run the commend "time gcc --version" , the real time should about 0.005s, but my PC prints "real 0.7s", it's very strenge. My cpu is i9-13980HX, it shouldn't have this problem.

DYHrich avatar Aug 28 '25 03:08 DYHrich

@DYHrich when you use time, you can probably see that usr and sys are both very low, it indicates heavy io. you can use strace to check what happens. I also use procmon from sysinternals to diagnose.

nopeless avatar Sep 17 '25 06:09 nopeless

已收到,谢谢

DYHrich avatar Sep 17 '25 06:09 DYHrich

@DYHrich when you use time, you can probably see that usr and sys are both very low, it indicates heavy io. you can use strace to check what happens. I also use procmon from sysinternals to diagnose.

My IO is normal. Now i have changed to use WSL. I have no idea how to solve this problem.

Thank you for your reply and advise!

DYHrich avatar Sep 18 '25 03:09 DYHrich

WSL is going to be faster no matter what, specifically for shell scripts since fork() overhead is non-existent there

If you still need msys, try to identify what subset of a command causes issues

When opening the ucrt64 shell, there is always a delay

When opening any msys shell, it loads /etc/profile, which loads a bunch of other scripts. You can disable some behavior by simply deleting lines, but there aren't any easy fixes for speeding up msys

nopeless avatar Sep 18 '25 16:09 nopeless