@nnethercote Hey! I had an idle thought that I'd be curious to get your take on: have you looked at the rustc startup cost in your speedup adventures? In Noria for example, each dependency compiles ~quickly, but there are a lot of them, so invocation cost could add up quickly.
3
3
I imagine some of the time would also go to things like rustup indirection, fork()+exec() cost, etc. But presumably there's also a decent startup cost to rustc itself? /cc @dsilverstone
1
It ought to be moderately easy to measure this. strace running rustc, then look at the time from initial exec of rustup, to the exec of the rustc, to when rustc opens its first input file.
1
1
FYI, on a fresh hello world on my laptop (SATA SSD, i7-6700HQ) `cargo build` -> cargo being invoked (rustup proxy time) 12ms. 39ms until cargo invokes rustc (proxy), 10ms until proxy runs rustc real for metadata. 8ms later, rustc run to compile, 11ms proxy 33ms until src read.

Jun 12, 2020 ยท 2:42 PM UTC

1
1
Yeah, that's interesting! In Noria, I think we have ~400 transitive dependencies, and several binaries and internal crates, so that's a lot of rustc calls, and potentially a decent chunk of time..