Compiling takes really long time

Even on an i9 and SSD sometimes the C++ compiler just seem to crash…
if more than 30 seconds pass, I cancel and restart compiler processes.