As an FYI, your mileage may differ severely, but for builds here, I've setup a tmpfs RAM disk on Linux which is large enough to fit the entire build output (object files), but not the build input (C, C++ code). We generate around 6G of objects, static, and shared libraries across about 3100 output files. Putting it onto a tmpfs RAM disk sped up the build around 10% for our workload. As the host has 32G of RAM and sits idle using a small portion of that, allocating 8G for a tmpfs RAM drive doesn't hurt. Large link steps were causing some pretty horrific system response times when on spinning disk, but those have gone away with using RAM.
I don't put the input files into tmpfs as I don't want to lose changes in the event of a system failure.
Home: PC-D600, Seasonic 850 Titanium, Apex X299, 7940X @ 4.1 GHz, H115i, 32G DDR4 3200, 960 Evo 1T+500G, 850 EVO 1T, GTX 1080, U3818+2x U2515h, Linux, Win10
Work: Arc Midi, 650TX, P8Z77-V LK, 3770, 32G, 830 128G, 2x1TB, NVS 295, 2xU3014, Linux