Top
Best
New

Posted by Bogdanp 6 days ago

Why is the Rust compiler so slow?(sharnoff.io)
301 points | 426 commentspage 5
o11c 6 days ago|
TL;DR `async` considered harmful.

For all the C++ laughing in this thread, there's really only one thing that makes C++ slow - non-`extern` templates - and C++ gives you a lot more space to speed them up than Rust does.

int_19h 6 days ago|
C++ also has async these days.

As for templates, I can't think of anything about them that would speed up things substantially wrt Rust aside from extern template and manually managing your instantiations in separate .cpp files. Since otherwise it's fundamentally the same problem - recompiling the same code over and over again because it's parametrized with different types every time.

Indeed, out of the box I would actually expect C++ to do worse because a C++ header template has potentially different environment in every translation unit in which that header is included, so without precompiled headers the compiler pretty much has to assume the worst...

sgt 5 days ago||
What happened with Zig and async? Last I heard they might never implement it.
ac130kz 6 days ago||
tldr as always, don't use Musl, if you want performance, compatibility.
ac130kz 5 days ago|
Some "smart" folks even downvote this advice. Yeah, I've seen articles on musl's horrible performance back in 2017-2018, and apparently it still holds, yet I get a downvote.
9rx 5 days ago||
You make it sound like a "downvote" has meaning or something.

It doesn't.

leoh 6 days ago||
tl;dr: it’s slow because it finds far more bugs before runtime than literally any other mainstream compiled language
luppy47474 6 days ago|
[flagged]