TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

How to speed up the Rust compiler in 2018

273 点作者 nnethercote大约 7 年前

8 条评论

ajross大约 7 年前
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 未加载
mastax大约 7 年前
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%.
oblio大约 7 年前
Is there any dedicated effort to speed up LLVM compilation? I imagine that would benefit a lot of languages.
评论 #16956725 未加载
评论 #16956730 未加载
jeffdavis大约 7 年前
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 未加载
leshow大约 7 年前
Is there a reason why you&#x27;d create 2 distinct repositories instead of just creating branches and adding new remotes?
评论 #16959642 未加载
评论 #16962037 未加载
评论 #16959676 未加载
Rafuino大约 7 年前
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 未加载
shmerl大约 7 年前
Is rustc still using forked llvm, or it&#x27;s already switched to upstream?
评论 #16960145 未加载
MikkoFinell大约 7 年前
Why is Rust so popular on HN? Honest question.
评论 #16957106 未加载
评论 #16957231 未加载
评论 #16957899 未加载
评论 #16960187 未加载
评论 #16957176 未加载
评论 #16957142 未加载
评论 #16958963 未加载
评论 #16958595 未加载
评论 #16957080 未加载
评论 #16960056 未加载
评论 #16957286 未加载
评论 #16957154 未加载