I've seen the comparisons for building between the i7 Mac Mini and the 10-core iMac Pro. The iMac Pro was faster, but not by any large margin. Disk I/O was a much larger factor in compile time than we expected, and linking created bottlenecks of single-threaded behavior, and so the Mac Mini, when upgraded with a larger and faster SSD, kept within spitting distance of the iMac Pro.
But considering the build time and size of the stuff I've regularly dealt with, an iMac Pro for development is usually overkill, outside of some specific niches. The Mac Pro even more so.
Depending on the size of the codebase, it's really hard to recommend either of those machines. Heck, even for larger codebases, if you can avoid building the whole world, the Mac Mini can still do your heavy lifting when looking at compile times. The bigger issue is not having access to a good GPU for compute if you work on projects like Affinity Photo with the Mini, but you can usually get good enough performance for testing out of the 5K iMac, which is about the sweet spot, IMO. You just can't buy that headless.