TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

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

51 pointsby davikrabout 1 year ago

7 comments

nixpulvisabout 1 year ago
Maybe I’m not reading carefully enough, but if you have to specify non-pure macros yourself, how do you know when you <i>didn’t</i> do that correctly?
评论 #39808473 未加载
boukabout 1 year ago
Hope this is upstreamed at some point. Good to see there&#x27;s still a lot of gains to be made for Rust compile time
评论 #39808489 未加载
bionhowardabout 1 year ago
Man, I did a bunch of work getting this whole extra crate just for one proc macro working to extract nested function ASTs from rust files,<p>and on the 2nd day of work after everything finally worked, it complained because I wanted to return the AST instead of a token stream.<p>Joke’s on me because I didn’t know you have to use proc macros to transform code and I wound up just rewriting it as a function. Hopefully that doesn’t screw up what I want to do, which is basically compile time correctness checking, but it probably will…<p>Feels like every time I try to make compile time functionality in rust, I wind up getting sucked into endless type-level shenanigans, and it works, as long as you can tolerate the error messages being nigh unreadable.<p>WTB “comptime” Rust
saurikabout 1 year ago
Given the conclusion that a painfully large amount of time is spent re-evaluating procedural macros and that this was largely mitigated by adding a cache, it would seem as if the linked discussion about &quot;const&quot; macros on the Rust language design forum is incorrectly analyzing the near-term need for deploying such a feature: they are concentrating on security use cases (which frankly seem a bit dubious to me) or (this one I hadn&#x27;t heard before but is in the thread) changing where they are packaged (which, to those of us in the peanut gallery wearing our separate compilation hats and prototype fan club hoodies, seems like a far-too-entrenched mistake in Rust&#x27;s design to bother fixing at this level) whereas being able to safely and automatically know which macros can be cached and which ones can&#x27;t be (particularly as I&#x27;d pray that the big listed use case from the article of a non-const macro--including a file as bytes--either already isn&#x27;t slow or clearly should be trivially fixed to not be slow) seems to be the real banner feature of having const macros be standardized.
评论 #39808525 未加载
jasonjmcgheeabout 1 year ago
Has anyone built a tool to suggest or automatically split a crate into sub-crates to help mitigate compile times?
评论 #39808535 未加载
stephendauseabout 1 year ago
Awesome. I there any chance of this change or something like it getting merged into the rustc compiler?
WhereIsTheTruthabout 1 year ago
Marketing talk<p>12s down to 6s is still abysmally slow for incremental<p>You change a value 10 times and you lost a minute already
评论 #39808306 未加载