Since macOS Sierra, compiling C code with clang or gcc is really, really slow.
Reinstalling El Capitan (even today) solves the issue.
Building on GNU/Linux is much faster.
Building on Windows AND on WSL is also much faster.
By slower, I mean twice (or more) the time to build a simple C project. (from 5-6 seconds to 15 seconds)
For information, I tested mainly with gcc-9 and clang-10 with my school projects.
I also used tcc 0.9.27, built from source, with a dummy make+C project, see below.
I am not sure about what to do, have anybody ecountered this ?
Moreover, the whole system is really slower and sluggish since Sierra, I really think that it is a macOS issue. Other OSes are still fast.
I need macOS for the iOS/tvOS toolchain, therefore I cannot switch.
Switching to a GNU/Linux distro would be nice if I could.
If anybody needs more specific data, do not hesitate.
Many thanks for your help !
Things I tested always on the same computer with this dummy repo edrflt/build_speed :
tcc 0.9.27, built from source
Ubuntu 20.04 (fast):
make -j5 0,94s user 0,53s system 342% cpu 0,428 total
Mac OS X Yosemite 10.10 (fast):
make -j5 1,84s user 1,05s system 284% cpu 1,016 total
Mac OS X El Capitan 10.11 (fast):
make -j5 3,04s user 1,18s system 316% cpu 1,332 total
macOS Catalina 10.15 (slow):
make -j5 6,01s user 3,35s system 193% cpu 4,827 total
gcc-9
Ubuntu 20.04 - gcc 9.3.0 from apt
make -j5 10,15s user 4,69s system 361% cpu 4,111 total
make -j5 10,13s user 4,74s system 357% cpu 4,162 total
make -j5 10,27s user 4,54s system 359% cpu 4,119 total
macOS Catalina 10.15 - gcc 9.3.0 from brew
make -j5 13,95s user 10,55s system 298% cpu 8,204 total
make -j5 16,91s user 12,81s system 252% cpu 11,752 total
make -j5 14,05s user 10,81s system 295% cpu 8,412 total
Notes :
My MacBook Pro is this one :
MacBook Pro (Retina 13, early 2015) - MacBookPro12,1
i5 5257U - 8GB
I am totally open to any tests, any suggestion.
I know I don't know enough about low level OS components and compilers, therefore if you have the time, explain me like I'm five.
I will take any time that would be needed.
This is not at all about macOS is better, GNU/Linux is better ... no no, this is about "I want my computer to get his speed back".