This is the weirdest Apple lineup I've ever seen - for CPU-intensive tasks, the hierarchy goes:
iMac Pro (various versions are faster, depending on how multithreaded the task is)
MacBook Pro 15" (especially the new Vega models we'll see soon - even many CPU-intensive tasks also use GPU)
Mac Mini (hampered by really bad Intel graphics if the task uses any GPU at all, but the new laptop 6 core i7 can handily outperform old desktop quad-cores)
iMac
Mac Pro (ancient - high core count versions can be competitive on extremely multi-threaded tasks)
There's a $1599 Mac Mini that looks awfully attractive compared to any non-Pro iMac - max the processor, take the (reasonably priced at $200) 10 gig Ethernet option, because 10 gig NAS boxes are really coming down in price (the cheapest 4-bay I could find at Newegg is an Asus for $359 plus drives), 512 GB SSD, and upgrade the RAM yourself. Another $400 buys the 1 TB SSD - assuming big data files are on the 10 gig NAS.
Under $3000 ($1599 for the computer, $300 for 32 GB of RAM, $359 for the NAS itself and $692 for 4 nice Hitachi DeskStar NAS drives)for a screamingly fast machine with a super-fast boot/application SSD and a 18 GB NAS for storage (10 gig Ethernet is faster than any four hard drives...).
Fool with this any way you like - don't need the NAS? Hang a couple of external drives off TB3/USB-C... (I'd still get the 10 gig option if you want to keep it for any length of time)
Want more SSD? The 1TB option isn't that horribly overpriced for the speed of the drive.
The only thing I couldn't find is the weird 32 GB SODIMMs that Apple's using to get to a 64 GB configuration. They show up on some HP and Lenovo laptop workstation price lists (also horribly overpriced), but they don't seem to appear on Newegg...
If you need GPU power, the Mini makes no sense - Apple would say "add an external GPU", but a modest one is $700-$800, and the high-performance model with a Vega 56 is $1200. Once you're paying that on top of a $1500-$2000 machine and a RAM upgrade, the iMac Pro starts to look attractive (or, oddly, a MacBook Pro)!
The one place where the 27" iMac still makes a lot of sense is if you really want the screen. It's a gorgeous media machine/family computer, and a lot of those tasks (playback, office applications, web, light photo/video editing, not heavy-duty editing) don't tax the processor...