abi-cafe
abi-cafe copied to clipboard
Compile multiple tests in parallel
This should significantly reduce the time it takes to run all tests as most of the time is spent during compilation, which is currently single-threaded.
Main problem to solve is properly buffering up compiler messages. Right now things are fairly interactive (although CC is annoyingly prone to spitting out tons of stuff on the assumption it's running in a build.rs still).
It seems that output buffering is already implemented for rustc. For clang and gcc using .output() should work fine too I think. For cc using a separate process for the cc crate usage would work I think.
That's probably the simplest/best approach. Main alternative is to do some upstream work to make cc-as-library-but-not-in-build.rs more usable.
I started stubbing this out with rayon par_iter but unfortunately the current test code races on the filesystem when setting up various dirs. So this is sadly a bit non-trivial.