Become a sponsor to Matyas Susits
The speed of the Rust compiler can be a problem. Just like with C++, recompiles can take 30+ seconds even for trivial changes. My goal is to change that. There is no fundamental reason why Rust cannot recompile large optimized binaries under a second when only a small part of the code changes. Saving developer time, reducing development costs, and just simply making Rust even more fun to use.
My current focus is on Relink Don't Rebuild, which is a great first step for fast recompilation of large projects. It works exceptionally well for 50-90% of typical edits, depending on the project. Achieving subsecond recompiles in those cases, regardless of project size.
To achieve subsecond recompiles for all edits, I plan to work on the following in the future, in no particular order:
Frontend: Rustc
- Incremental resolver and macro expansion
- Zero copy incremental cache
- Converting parts of the incremental pipeline to be push/diff based
Backend: Changes to LLVM, Cranelift or GCC
- Making optimizations inside a codegen unit (for example inlining) parallel, so that single codegen unit compilation is as fast as multiple codegen units
- Making global, cross function optimizations incremental
Linking
- Incremental linking
Developer workflow integration
- Adding a
cargo worktreesubcommand similar togit worktree, but it also sets up files and the target directory in a way that there is no need for a full recompile of the incremental build artifacts
1 sponsor has funded susitsm’s work.