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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

How to speed up the Rust compiler some more

170 点作者 nnethercote超过 8 年前

5 条评论

ronjouch超过 8 年前
The post goes directly from <i>&quot;heap allocations were frequent within rustc&quot;</i> to <i>&quot;effort to minimize heap allocations&quot;</i>, and proceeds to detailing speedups.<p>→ Systems programming newbie question: why are heap allocations bad for performance? Is it the additional level of indirection? The cost of calling your memory allocator? Something else?<p>My background, if that helps focusing answers: python&#x2F;js programmer, did a tiny bit of C&#x2F;C++, am ~approximately~ familiar with the stack (call frames, each with its context) vs. the heap (where to allocate memory for big&#x2F;long-lived objects e.g. arrays and trees).
评论 #13022644 未加载
评论 #13022395 未加载
评论 #13026243 未加载
评论 #13022672 未加载
stevedonovan超过 8 年前
Here&#x27;s some thinking outside the box. Traditional compilers are focused on building an executable as fast as possible, throwing away an enormous amount of state each time. The new rustc incremental compilation attempts to re-use some of that computed state, although still early days. If however the compiler&#x27;s state remains persistent (it is running as a daemon) then small code changes should usually be pretty fast - it&#x27;s analogous to the code scanners of Eclipse. If the target of the compiler isn&#x27;t a native executable, but a continuously updated image containing code, then the link gets pretty fast as well. The result will not be fast, but it will be _fast enough_ to test changes.
评论 #13021787 未加载
评论 #13021394 未加载
评论 #13021636 未加载
评论 #13021949 未加载
评论 #13021357 未加载
评论 #13027656 未加载
wyldfire超过 8 年前
Can rust capitalize on LTO&#x2F;PGO? Even if that&#x27;s not quite ready for primetime, if we&#x27;re spending 50% or more time in the LLVM backend, that certainly can be built with LTO&#x2F;PGO.<p>Seems like it might be worth the trouble&#x2F;bootstrapping challenge if it yields another ~5%.
评论 #13021070 未加载
vanderZwan超过 8 年前
Nice article, although I would have liked to see a before&#x2F;after summary bar chart of the benchmarks for all PRs as a whole; I&#x27;m curious how all these incremental improvements add up together.
评论 #13022751 未加载
评论 #13026257 未加载
TazeTSchnitzel超过 8 年前
Is heap allocation actually unavoidable? PHP uses an arena allocator for its AST. I don&#x27;t know how applicable that could be to Rust.
评论 #13023674 未加载
评论 #13023809 未加载
评论 #13023510 未加载