logoalt Hacker News

thevinter • today at 1:42 PM • 1 reply • view on HN

First of all, the fact that the article talks about "speeding up" the rust compiler doesn't automatically mean that the compiler is "slow"[0].

Now, is rustc slower than e.g. clang? by how much? why?

Those are different (and complicated) questions. It really depends on what you're compiling, but I'd say rustc can be 1-5x slower (maybe more at times?).

The reasons are many and varied, but in general rust compilation is slower because the compiler is doing way more things compared to C (monomorphization, complex trait resolution + type inference, borrow checker..)

[0]: Also I'd argue that "slow" without a concrete point of reference is a meaningless term in this context.


Replies

Joker_vD • today at 2:44 PM

> the fact that the article talks about "speeding up" the rust compiler doesn't automatically mean that the compiler is "slow"

Well, if it weren't "slow" for some definition of "slow", nobody would bother speeding it up, would they?

➕ show 1 reply