Compilation speed dependent on CPU?
Things you are missing is 


RAM performance: Intel CPUs has lower memory latency, and compilation speed significantly depends on memory latencies
Amount of cores/threads: each Ryzen core is slightly slower than Intel core, but it has 1.5x more cores, and each core can run 2 threads. This makes it 1.5x faster for ideal multi-threaded tasks (like benchmarks), but real programs may be not ideally scale from 4 to 12 threads
SSD speed, in particular 4K IOPS (i.e. speed of reading many small files)


F.e. first test on this page compares C++ compile times on various Intel/AMD CPUs:


8700K: Intel 6-core
7820X: Intel 8-core with slower memory controller
2700X: AMD 8-core
2600X: AMD 6-core


As you can see, Intel 6 cores outperformed AMD 8 cores and even Intel's own 8 cores coupled with slower memory controller.

And this page discusses a lot memory/cache latencies.