dslm4515 / CMLFS

Clang-Built Musl Linux From Scratch
MIT License
99 stars 18 forks source link

Tip for new contributors, testers or users: "MAKEOPTS=”-j${core} +1″ is NOT the best optimization" #41

Open takusuman opened 2 years ago

takusuman commented 2 years ago

I've read this some time ago, and i thought it would be cool to share this article with you guys. Here Agostino tests and benchmarks if using -j $(( n + 1 )) is any better than just using -j $n, and the conclusion is that its not.

https://blogs.gentoo.org/ago/2013/01/14/makeopts-jcore-1-is-not-the-best-optimization/

owl4ce commented 2 years ago

Sure, it's overload.

owl4ce commented 2 years ago

And, for some reasons e.g doing multitask, consider to set the load average. The value same as core/thread.

owl4ce commented 2 years ago

Also, I've test building a package with realtime (RT) priorities, the results is bad.

dslm4515 commented 2 years ago

The way I look at it, each job thread should be assigned per cpu thread. An extra job thread on a CPU thread would be cumbersome and likely slow down the overall compilation.

Hopefully I'm using the correct terminology. There are some CPU's that have 1 thread for every CPU core and others may have 2 threads instead. My i3-3220 CPU is dual core but has a total of 4 threads. So, I build with -j4.

dslm4515 commented 2 years ago

Also, I've test building a package with realtime (RT) priorities, the results is bad.

Thanks for the heads up. I will consider it when I start Optimux-C (optimized CMLFS)