|
|
Log in / Subscribe / Register

Rust and GCC, two different ways

Rust and GCC, two different ways

Posted Oct 9, 2021 4:58 UTC (Sat) by ncm (guest, #165)
In reply to: Rust and GCC, two different ways by eru
Parent article: Rust and GCC, two different ways

Another potential benefit is that the Gccrs implementation has a chance to be much, much faster than rustc. That is not to say it will be, but there is enormous room for such improvement. The monumental slowness of the rustc compiler probably keeps it out of more production workflows than does its limited target-platform set.


to post comments

Rust and GCC, two different ways

Posted Oct 11, 2021 16:29 UTC (Mon) by ssokolow (guest, #94568) [Link]

Bear in mind that they're already working on a Cranelift backend for it to speed up debug builds.

Rust and GCC, two different ways

Posted Oct 11, 2021 16:51 UTC (Mon) by moltonel (subscriber, #45207) [Link]

I think you underestimate how optimized rustc (the frontend) already is. Its performance is monitored very closely, and the gains indicate that the remaining room for improvement is small. It has very advanced incremental (re)compilation support, and is thoroughly multithreaded. The gccrs frontend will have a hard enough time catching up to and keeping up with rustc features, I wouldn't count on it keeping up with the optimization work.

Most of the time is spent in the backend, which is why rustc's cranelift backend (which predates rustc_codegen_gcc and focuses on quick but unoptimized compilation) is very interesting for debug builds. There are surely going to be differences between the GCC and LLVM backends, but judging by the Clang vs Gcc benchmark for C and C++, there's not going to be one clear winner. Same goes for the speed of the compiled code.

Rust is a complex language, it's never going to compile as fast as Go. It compiles about as fast as C++ (comparisons are hard, beware of apples-to-oranges), which is what you can hope for.


Copyright © 2026, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds