Slow compilation time on linux

I have 32gb of ram, Intel I7-7700 and Ubuntu 18.04,
I am using clion and basicly just build from there “development target”.
Changing one cpp results in 30-40 sec compilation.
Changing header file can from 100-300 seconds.
Also sometimes it’s randomly recompiles the whole project.
Is it expected result?
Is there any advice to boost compilation time specificly for linux?

You are not alone. I also have 32gb, Ryzen 7 2700X and Ubuntu 18.10. Even if I change no files and click on Compile, just linking takes 20-30 seconds with the 3rd Person Example.