Are both cases compiling to the same target architecture? If not, you may well be comparing the relative performance of different compiler backends instead of comparing the performance of your CPUs.
(+ now I see it's rust: how parallel is your build, really?)
> now I see it's rust: how parallel is your build, really?
Not the OP but I install a lot of Rust projects with Cargo and recently did some benchmarking on DigitalOcean's compute-optimized VMs. Going from 8 cores to 32 cores was a little disappointing:
Bat (~40 crates): 68s -> 61s
Nushell (486 crates): 157s -> 106s
Compilation starts out highly parallel and then quickly drops down to a small number of cores.
(+ now I see it's rust: how parallel is your build, really?)