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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

I reduced (incremental) Rust compile times by up to 40%

11 点作者 kapilsinha大约 1 年前

4 条评论

nindalf大约 1 年前
I think this is unlikely to gain traction. I say that no to discourage you, just to explain.<p>- The community has an instinctive distrust of closed source or a compiler from an untrusted source. If you’re familiar with the Trusting Trust attack you’ll understand why. People won’t send their code to you to compile, because they’re afraid of it being modified. People won’t use a closed source compiler, when an open source trusted one is available.<p>- Dev tools in every language ecosystem are almost always free, but sometimes even free tools don’t get adopted. Look the experience of the guy who built the mold linker(<a href="https:&#x2F;&#x2F;github.com&#x2F;rui314&#x2F;mold">https:&#x2F;&#x2F;github.com&#x2F;rui314&#x2F;mold</a>). Far superior to the state of art, improves incremental compiles a lot, widely applicable across ecosystems (C, C++, Rust), CPU architectures and Operating Systems. You don’t even have to modify your compiler, just need to point to his linker. He’s even giving it away for free for personal use. But still, almost no one uses it. The inertia of the established options is really high.<p>- It’s not complex enough. Think about the complexity involved in the cranelift backend. No one can seriously recreate the efforts of bjorn3. If we could have, we would have. But the idea idea here can be recreated, especially by the experts who already built incremental compilation into rustc.<p>- But if your solution is truly complex, like the parallel frontend, the burden of maintaining a fork would be too high. You’d have to spend all your time rebasing.<p>Again I’m not trying to discourage you, just stating the difficulties of making a business in the dev tools space. You would be better off contributing this excellent work to the community and trying a different tack.
评论 #39754342 未加载
CJefferson大约 1 年前
I’m not sending you my code to compile on your machine.<p>I understand wanting to make a successful product, and keepin your secret magic secure, but I’m afraid this just sets off so many alarm bells for me.
评论 #39754187 未加载
kapilsinha大约 1 年前
Hi HN, I’m Kapil from CodeRemote. I am building Rust developer productivity tooling to speed up your edit-compile-run cycle. While I love Rust for its runtime performance and safety (not to mention its sweet syntactic sugar), I have long been frustrated with the resultant compile times.<p>This frustration hit a tipping point a few months ago, as I was building on a sluggish framework that made heavy use of code generation. From the Rust&#x2F;Cargo&#x2F;Rustc books and Rust community’s blog posts, I picked up and applied most of the standard tricks to speed up builds — but with only marginal improvement. Continued frustration led to me profiling and analyzing compile times, and soon I landed at the Rustc (compiler) source code…<p>I modified the compiler and implemented procedural macro caching, which has considerably sped up incremental builds for projects with macro-heavy dependencies. My fork of the compiler is still private as I’m still thinking through the licensing model; but if you’re interested in trying it out, please hit the “sign up” at the bottom of the blog. I am packaging it into a build&#x2F;development server for a few Rust dev teams, and have already shared it with a few self-hosters! In this blog post, I discuss in detail my macro caching implementation and results. I’d love to hear your thoughts, and I’m happy to talk further about my compiler modifications.
periram大约 1 年前
This directly addresses one of the core gripes about Rust - long compile times. Very nice to see efforts to address exactly that.<p>Would be quite interested to learn how this was achieved.
评论 #39746390 未加载