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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Speeding Up the Rust Compiler

351 点作者 staktrace超过 5 年前

7 条评论

ChrisSD超过 5 年前
Note that `cargo check` is faster than doing a full compile. Also I use the `rust-analyzer` language server for IDE integration to catch errors as I write them. Between the two, my workflow usually avoids the need for actually compiling a binary until I'm ready to run tests.
评论 #21762220 未加载
评论 #21761975 未加载
评论 #21763486 未加载
bluejekyll超过 5 年前
rustc might never be as fast as the Go compiler because the language has so many additional features, but it always makes me so excited to see the continued progress in making the compiler ever faster.<p>Thank you for the hard work here!<p>Btw, mentioned in the article are these tools: “ All of the above improvements (and most of the ones in my previous posts) I found by profiling with Cachegrind, Callgrind, DHAT, and counts, but there are plenty of other profilers out there.” Does anyone have any good resources on using these with Rust, or just in general with C or C++?
评论 #21761118 未加载
评论 #21767727 未加载
frenchman99超过 5 年前
One of the things with Rust is that while the compiler could be considered slow, once your Rust code compiles, if you stay away from `unsafe` code and `unwrap()`, the code is usually bug free (apart from logic bugs that no compiler could catch). At least that&#x27;s been my experience with Rust.
评论 #21762921 未加载
评论 #21761391 未加载
评论 #21762545 未加载
评论 #21761315 未加载
derefr超过 5 年前
&gt; The PR gave some very small (&lt; 1%) speed-ups on the standard benchmarks but sped up a microbenchmark that exhibited the problem by over 1000x, and made it practical for procedural benchmarks to use tokens.<p>Does this imply that existing benchmarks weren’t catching the problem here because they were <i>avoiding making use of a feature because it was too slow</i>? That seems like a strange way to write a benchmark, especially if tokens were actually in common use in the compiler itself.
评论 #21764480 未加载
fnord77超过 5 年前
We have a fairly small but complex library written in Rust.<p>a debug compile takes about 5 minutes from clean. Release takes 18 minutes. (1.38.0)
评论 #21762879 未加载
评论 #21763804 未加载
评论 #21762797 未加载
评论 #21764256 未加载
eb0la超过 5 年前
Looks like if you&#x27;re using an &#x27;old&#x27; release (&lt;=1.36 , like me) it is time to upgrade.<p>Performance improvements in this post are from november&#x27;19 to december&#x27;19 - IMHO the november version _already_ had impressive optimizations.
xiphias2超过 5 年前
One thing that was not addressed is why the effort is not put into making the parallel compiler default. It would give a 8x speedup on a developer machine compared to 10% speedups from these optimizations, especially when AMD releases the Zen 2 architecture for laptops.
评论 #21762428 未加载
评论 #21763794 未加载