make -j
2019-09-13
The manpage for GNU make says of the -j
option,
“If the -j option is given without an argument, make will not limit the number of jobs that can run simultaneously.”
Now I somehow read this as claiming that it would just use however many cores you have to work with (well, threads, I suppose); on a 8-thread machine, you’d get 8 build processes at once. That… is not what it means. What’s really remarkable to me is that even as my status bar reported a system load over 300, things stayed remarkably responsive. In particular, htop happily showed me gcc eating my system, and I had no trouble switching tmux windows to kill the build. I suspect that I lucked out because the build processes were all blocking on disk, so they weren’t competing with my interactive processes. It’s also possible that I was insulated by running the build in Docker, come to think of it; I don’t knoow if it does any magic with cgroup and niceness, but I wouldn’t be surprised.
Anyways, I’ll stick with make -j"$(nproc)"
or so in the
future:)