If you can afford it, definitely invest in the Threadripper 3960x, 3970x or even the 3990x. These things tear through compilation workflows so good there’s not even a contest in that area unless you want to pay $30,000+ for certain Xeon Platinum dual-processor setups.
If that’s way outside your budget (the 3990x famously costs $3990) then a Ryzen 3900x is very adequate as well. Still, have in mind that investing in the current Threadripper generation can definitely last you some 10 years – with the PCIe 4.0 slots on your motherboard you honestly won’t need an upgrade unless you plan on playing 16k VR games.