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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

I Improved My Rust Compile Times

139 点作者 excsn大约 1 年前

16 条评论

dan_can_code大约 1 年前
As a front-end developer dabbling with rust, the compiler being slow is not a problem for me. Whilst I appreciate the benchmark, it&#x27;s not likely I&#x27;ll have 72GB of ram laying around to speed up the process.<p>Yes, hot module reloading is nice and quick. But it reloads with errors included.<p>The primary benefit of the rust compiler, at least from my point of view, is telling me what&#x27;s wrong, where. It&#x27;s a worthwhile sacrifice for a few seconds of my time, when at the end of addressing all of the obvious errors, I have something that works. I find this miles better than HMR.
评论 #39763799 未加载
评论 #39763967 未加载
评论 #39763608 未加载
评论 #39764191 未加载
评论 #39763519 未加载
评论 #39763969 未加载
评论 #39763775 未加载
nextaccountic大约 1 年前
&gt; Note: Discord User @PaulH(and a couple others) let me know about this bug that prevents the server build from using the dependencies built for the previous compilation of the server&#x2F;webassembly frontend build due to changes in the RUSTFLAGS. You can fix this by having cargo-leptos &gt; 0.2.1 and adding this to you Cargo.toml under your Leptos settings block. I did not test with this enabled.<p>&gt; [package.metadata.leptos]<p>&gt; separate-front-target-dir = true<p>This option is deprecated since cargo-leptos 0.2.3 (now it&#x27;s enabled unconditionally), it&#x27;s going to be removed in 0.3<p><a href="https:&#x2F;&#x2F;github.com&#x2F;leptos-rs&#x2F;cargo-leptos&#x2F;pull&#x2F;216">https:&#x2F;&#x2F;github.com&#x2F;leptos-rs&#x2F;cargo-leptos&#x2F;pull&#x2F;216</a><p><a href="https:&#x2F;&#x2F;github.com&#x2F;leptos-rs&#x2F;cargo-leptos&#x2F;issues&#x2F;217">https:&#x2F;&#x2F;github.com&#x2F;leptos-rs&#x2F;cargo-leptos&#x2F;issues&#x2F;217</a><p><a href="https:&#x2F;&#x2F;github.com&#x2F;leptos-rs&#x2F;cargo-leptos&#x2F;commit&#x2F;b0c19a87cff2e0fb9bac0d9c6d274c38069ed2b5">https:&#x2F;&#x2F;github.com&#x2F;leptos-rs&#x2F;cargo-leptos&#x2F;commit&#x2F;b0c19a87cff...</a>
klabb3大约 1 年前
Is it an unpopular opinion to say 75% of “a lot” is still “a lot”, plus now you have to keep track of the knobs and constantly monitor for and be conscious about not wrecking build times as you’re maintaining and developing.<p>I’ve found in 10+ years of software development that speed of iteration cycle is highly correlated with productivity. Compile times is not the only input into this cycle time, but it’s a big one, and importantly, it’s within the control of the language tooling itself to solve. The human idle attention time of 1-2 seconds should be the gold standard to strive for, even if not always achievable.<p>There seems to be quite a bit of cope around Rust build times in the community, which was natural a few years ago (a lot of people used to “blame” llvm, but it doesn’t seem to be as big of a culprit) but things are different now, no? Given the maturity, growing ecosystem and corporate investment, I would expect incremental build speedup to be prioritized, and steadily improving. But clearly it isn’t moving very fast in that direction. So why not?
评论 #39764246 未加载
评论 #39765047 未加载
评论 #39764674 未加载
rui314大约 1 年前
The sold linker is no longer commercial software; it&#x27;s been relicensed under the MIT license.
评论 #39763532 未加载
评论 #39763405 未加载
denysvitali大约 1 年前
Their benchmarks are based on a machine with 72GB of RAM and another with 128GB of RAM - not that it does matter, but I&#x27;m really curious if they&#x27;re outliers or if I should bump my computer specs. That&#x27;s a lot of Electron web apps running in parallel!
评论 #39763280 未加载
评论 #39763227 未加载
评论 #39763140 未加载
评论 #39763947 未加载
评论 #39763218 未加载
KingOfCoders大约 1 年前
From my experience, faster SSD have a suprising strong effect for some (simple) languages (probably not Rust), like Go [0]<p>[0] <a href="https:&#x2F;&#x2F;www.octobench.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.octobench.com&#x2F;</a>
dgellow大约 1 年前
I’m not sure I understand why editing an html template requires to recompile the rust project. I implemented a static site generator in rust for my own projects, html templates are simple liquid template files, it’s instant to recompile them. Same for stylesheets. Is the author generating the html from rust directly? If yes that sounds like a painful strategy
rbalint大约 1 年前
75% is really good even if it requires changing the toolchain. Have you tried <a href="https:&#x2F;&#x2F;github.com&#x2F;firebuild&#x2F;firebuild">https:&#x2F;&#x2F;github.com&#x2F;firebuild&#x2F;firebuild</a> ? It is a caching accelerator and it can cache the linking and the buildscripts, too in Rust builds. It can make your builds more than 90% faster, especially with low cores counts. <a href="https:&#x2F;&#x2F;balintreczey.hu&#x2F;blog&#x2F;improve-build-time-of-rust-java-and-intel-fortran-projects-with-firebuilds-new-release&#x2F;" rel="nofollow">https:&#x2F;&#x2F;balintreczey.hu&#x2F;blog&#x2F;improve-build-time-of-rust-java...</a> The Mac port is experimental, though.
SushiHippie大约 1 年前
Looking at some benchmarks online and the 7900x always beat the 5950x even though the 5950x has more cores.<p>But in this article the 7900x performed worse than the 5950x, is it because of the core count, or are there some other factors?
eikenberry大约 1 年前
<a href="https:&#x2F;&#x2F;web.archive.org&#x2F;web&#x2F;20240320042828&#x2F;https:&#x2F;&#x2F;benw.is&#x2F;posts&#x2F;how-i-improved-my-rust-compile-times-by-seventy-five-percent" rel="nofollow">https:&#x2F;&#x2F;web.archive.org&#x2F;web&#x2F;20240320042828&#x2F;https:&#x2F;&#x2F;benw.is&#x2F;p...</a>
daghamm大约 1 年前
First time I hear about mold.<p>The performance looks good, but are there any plans for any other improvements such as LTO?
评论 #39764055 未加载
winrid大约 1 年前
The coolest thing about this to me IMO is the comparison between the two CPUs.<p>Is there a project that publishes benchmarks compiling projects across different CPUs? I know passmark is kinda the go-to but this would be cool.<p>Someday I&#x27;ll feel the need to upgrade from a 2700x...
评论 #39763658 未加载
评论 #39763671 未加载
richrichie大约 1 年前
The older i get the more i am convinced that there-ain’t-no-free-lunch applies widely, beyond financial markets.<p>Software development: the art of redistributing aggregate lifecycle pain; who bears what, when and how much.
评论 #39764716 未加载
tempaccount420大约 1 年前
Very cool, still kind of disappointing the author was only able to get incremental compilation down to 4.5s, no matter the baseline. Hopefully Cranelift lands in stable at some point.
评论 #39763448 未加载
beeb大约 1 年前
Super interesting! I would have loved to see included in the potential solutions the use of sccache too
rob74大约 1 年前
I really wish people wouldn&#x27;t use AI-generated images for blog posts, it&#x27;s so distracting! I clicked the link wanting to read the article, but instead spent several minutes looking at the image to find errors: what&#x27;s shown on the screen (apparently it&#x27;s &quot;Jot Commeditin&quot;) looks like something between a hex dump, git blame, and occult incantations written in a long-forgotten alphabet. Probably you need a keyboard like the one on the desk (with keys arranged in a fractal pattern) to write something like that. And a mouse with a cable going nowhere...
评论 #39764244 未加载
评论 #39764199 未加载
评论 #39764171 未加载
评论 #39764291 未加载