6 ms·
> written in Zig instead of C++, uses significantly less memory, and represents a modest performance improvement That's particularly interesting considering th
by geophertz 4y ago
> written in Zig instead of C++, uses significantly less memory, and represents a modest performance improvement
That's particularly interesting considering the rust compiler in rust has never been as fast as the original OCaml one
- sanxiyn 4y agoWell, OCaml Rust compiler also didn't use LLVM and used its own lightweight code generator and I think self-hosted Rust compiler frontend was in fact faster than OCaml Rust compiler frontend.
- parentheses 4y agoWith both projects, how much of the improvement is simply building for the second time?
- sanxiyn 4y agoFor Rust, I think improvement was almost entirely due to LLVM producing faster code. That's not applicable to Zig case, since both old and new compiler use LLVM. I don't know enough about Zig to answer.
- est31 4y agoI wonder how much this statement still holds. I've never used the OCaml bootstrap compiler but performance wise, the rust compiler has improved incredibly since the 1.0 release.
- sanxiyn 4y agoAn apple to apple comparison is impossible because rustboot compiled a very different language. But I suspect suitably updated rustboot would be still faster because compilation time is dominated by LLVM.
- pcwalton 4y agoRustboot's code generator was generally slower than LLVM. I think in some small test cases it might have been faster, but when implementing stuff like structure copies rustboot's codegen was horrendously slow because it would overload the register allocator.
- kibwen 4y agoThe original OCaml compiler didn't have essentially any of the static analysis that Rust would eventually be known for. Rust in 2011 (when rustc bootstrapped) was dramatically different from what would later stabilize in 2015.
- pcwalton 4y agoHuh? That's not true at all. It took over 30 minutes to compile the self-hosted Rust compiler with the OCaml compiler, when rustc was far smaller than it is today. rustboot was agonizingly slow, and one of the main reasons why I was so anxious to switch to rustc back in those days was compilation speed. I was there and had to suffer through this more than virtually anyone else :)
- geophertz 4y agoMy source: https://pingcap.com/blog/rust-compilation-model-calamity#bootstrapping-rust https://pingcap.com/blog/rust-compilation-model-calamity#boo... > 7 femto-bunnies - rustboot building Rust prior to being retired > 49 kilo-hamsters - rustc building Rust immediately after rustboot's retirement > 188 giga-sloths - rustc building Rust in 2020