I know others would do it differently, but for me compiling speed was more important than low price or expandability so my choice was between M2 Max on a MacBook Pro and a M1 Ultra on a Mac Studio.
The profiling indicated those quite were close in performance so I went with the laptop. My main compromise was to choose 14in as it’s plugged into a monitor most of time so I could optimize for travel more than a big screen when the monitor isn’t there.
In the end I’m super happy with it. The M2 Max is a monster for compiling and is probably 5x faster for builds than my previous Intel-based MacBook Pro