TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

How to speed up the Rust compiler in 2018

273 pointsby nnethercoteabout 7 years ago

8 comments

ajrossabout 7 years ago
So... grumpy old man response here:<p>These are all tiny, targetted microoptimizations worth a percent or three of benefit in specific tests. They&#x27;re worth doing (or at least evaluating) in any mature product and I have no complaint.<p>Nonetheless rustc remains <i>really</i> slow relative to other similar technologies, including C++ compilers. Is there any consensus as to why?<p>I mean, with C++, the answer is something to the effect of &quot;template expansion happens syntactically and generally has to be expressed in headers, leading to many megabytes of code that has to be compiled repeatedly with every translation unit&quot;. And that isn&#x27;t really amenable to microoptimization. We all agree that it sucks, and probably can&#x27;t be fixed with the language as it&#x27;s specified, and chalk it up to a design flaw.<p>What&#x27;s the equivalent quip with rustc? I mean... is it going to get faster (in a real sense, not micro), or is it not? Is this fixable or not, and if not why?
评论 #16961017 未加载
评论 #16960806 未加载
评论 #16960108 未加载
评论 #16962633 未加载
评论 #16960676 未加载
评论 #16960714 未加载
评论 #16960381 未加载
评论 #16960184 未加载
mastaxabout 7 years ago
If you&#x27;re interested in the current &quot;grand plans&quot; for performance, check out this issue: <a href="https:&#x2F;&#x2F;github.com&#x2F;rust-lang&#x2F;rust&#x2F;issues&#x2F;48547" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;rust-lang&#x2F;rust&#x2F;issues&#x2F;48547</a><p>The query parallelization work has been coming along. Also it was recently discovered that building LLVM with a recent clang and doing cross-language LTO speeds up builds by ~25%.
oblioabout 7 years ago
Is there any dedicated effort to speed up LLVM compilation? I imagine that would benefit a lot of languages.
评论 #16956725 未加载
评论 #16956730 未加载
jeffdavisabout 7 years ago
A recent good experience with rust: wanted to learn a little about machine learning. Found a crate called rusty-machine, copied some examples from the docs, and built them.<p>No problems, compiling all of the dependencies was fast, examples worked, and in literally about 2 minutes I had a neural net and was hacking on it.<p>This is without touching rust in months.
评论 #16960130 未加载
leshowabout 7 years ago
Is there a reason why you&#x27;d create 2 distinct repositories instead of just creating branches and adding new remotes?
评论 #16959642 未加载
评论 #16962037 未加载
评论 #16959676 未加载
Rafuinoabout 7 years ago
Total noob question here, but how does the hardware you&#x27;re using affect compilation speed? What&#x27;s the baseline hardware being used in this benchmark he runs? There&#x27;s no way to recreate the benchmark environment unless we know this.<p>When someone like ajross says rustc is <i>really</i> slow, how slow are we talking?
评论 #16961509 未加载
shmerlabout 7 years ago
Is rustc still using forked llvm, or it&#x27;s already switched to upstream?
评论 #16960145 未加载
MikkoFinellabout 7 years ago
Why is Rust so popular on HN? Honest question.
评论 #16957106 未加载
评论 #16957231 未加载
评论 #16957899 未加载
评论 #16960187 未加载
评论 #16957176 未加载
评论 #16957142 未加载
评论 #16958963 未加载
评论 #16958595 未加载
评论 #16957080 未加载
评论 #16960056 未加载
评论 #16957286 未加载
评论 #16957154 未加载