|
|
Log in / Subscribe / Register

Rust and GCC, two different ways

Rust and GCC, two different ways

Posted Oct 11, 2021 16:51 UTC (Mon) by moltonel (subscriber, #45207)
In reply to: Rust and GCC, two different ways by ncm
Parent article: Rust and GCC, two different ways

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.


to post comments


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