How to speed up the Rust compiler in September 2026
Thread
Loading the complete thread in the background. This saved snapshot is available now. Refresh
Unofficial Hacker News client; not affiliated with Y Combinator.
How to speed up the Rust compiler in September 2026
Loading the complete thread in the background. This saved snapshot is available now. Refresh
Unofficial Hacker News client; not affiliated with Y Combinator.
torutofu · · focus · HN ↗
Citrusoff · · focus · HN ↗
[dead]
embedding-shape · · focus · HN ↗
dev_hugepages · · focus · HN ↗
pjmlp · · focus · HN ↗
Surac · · focus · HN ↗
What is the performance killer?
JMKH42 · · focus · HN ↗
pjmlp · · focus · HN ↗
panstromek · · focus · HN ↗
What do you mean by this?
pjmlp · · focus · HN ↗
Some tooling ideas go all the way back to when C++ vendors started adopting ideas from Smalltalk and Lisp, e.g. Energize C++ or Visual Age for C++ v4.
Or build systems like ClearMake from ClearCase, where the object files and binary libraries are shared across everyone on the cluster with the same views (ClearMake speak for what files/branches are selected).
ModernMech · · focus · HN ↗
dralley · · focus · HN ↗
Generics/monomorphization and how iterators work results in a lot of compiler bytecode that has to be churned through. More bytecode = longer compilation. It increases the size of the (debug) binaries, the debuginfo in general, causes performance issues with debug binaries in some situations unless you bump the optimization level, causes more IO, etc.
ModernMech · · focus · HN ↗
dralley · · focus · HN ↗
ModernMech · · focus · HN ↗
moritzruth · · focus · HN ↗
kibwen · · focus · HN ↗
tialaramex · · focus · HN ↗
All three of those words can mean "just like Rust" but equally "Not at all like Rust" for different languages.
Two examples to contrast: In C++ the iterators are basically a pointer analog (in some cases they're just literally pointers) and that's a very difference "feature" but it's still definitely iterators. In Ginger Bill's Odin, the iterators are a function, possibly generic, which returns a pair, the next item and a boolean telling you whether the iterator was exhausted.
gf000 · · focus · HN ↗
On top the borrow checker and other features are non-existent in these languages.
pjmlp · · focus · HN ↗
thevinter · · focus · HN ↗
Now, is rustc slower than e.g. clang? by how much? why?
Those are different (and complicated) questions. It really depends on what you're compiling, but I'd say rustc can be 1-5x slower (maybe more at times?).
The reasons are many and varied, but in general rust compilation is slower because the compiler is doing way more things compared to C (monomorphization, complex trait resolution + type inference, borrow checker..)
[0]: Also I'd argue that "slow" without a concrete point of reference is a meaningless term in this context.
Joker_vD · · focus · HN ↗
Well, if it weren't "slow" for some definition of "slow", nobody would bother speeding it up, would they?
bryanlarsen · · focus · HN ↗
jerf · · focus · HN ↗
If you want something like Rust that offers guarantees and checks and cross-checks by the boatload, it adds up. Macros, monomorphization, implicit code generation with traits and all those other things add up too. And you can't always get O(n) or O(n log n) code to implement those checks. Maybe it can be sped up and maybe there's tricks here or there, but at the Pareto frontier, a language that has more checks will be slower to compile than one that has fewer.
And that's not a bad thing or a deficit in Rust, it's just the nature of the beast.
ch4s3 · · focus · HN ↗
eikenberry · · focus · HN ↗
ModernMech · · focus · HN ↗
So the focus on Rust compile time is misplaced. It's not a big deal in terms of overall productivity.
gpm · · focus · HN ↗
ModernMech · · focus · HN ↗
vlovich123 · · focus · HN ↗
estebank · · focus · HN ↗
Some ideas to speed up compilation by not evaluating items that are not used might pan out significantly for big crates in your dep tree (that behavior might never be stable because that would allow items with compile errors in a crate that would still let your application compile, which is against the Rust approach). The same work to do that would also allow overlapping of crate evaluation between different rustc instances called by cargo, as it would require partial evaluation of crates (to do name res only and gather the symbols needed from its deps).
I know people are working on a bunch of different strategies to improve both first and incremental compile times, and I'm looking forward to the fruit of their labor.
Compile times are rarely the bottleneck for me, but that doesn't mean I won't welcome any improvements on that front.
nicoburns · · focus · HN ↗
Is that still true with modern linkers like `wild`? Seems like it can link Chromium in 1-2s.
> Another thing is that stable rust doesn't treat macros as idempotent
This seems absolutely insane to me given how pervasive macros are in Rust (I wonder how much of incremental compilation time is just repeated serde derives?). Obviously we can't just blindly treat all macros as idempotent, but an opt-in attribute on a macros that pinky-promises that it is seems like it ought to be pretty easy to implement?
Maybe somebody's looked into it and it doesn't help much? But I've heard (unverified) rumours of the opposite.
estebank · · focus · HN ↗
Wild improves things significantly, but it really depends on the kind of project. For some a third of the time can be linking. And not everyone configures their environment to use a different linker. Another thing that can easily improve performance is changing the global allocator, but I've seen teams that measured 10% perf improvements in their own metrics decide against going with anything other than the "default".
I fully expect that if wild delivers an effective incremental linking architecture, then rustc will be able to produce the patches directly (instead of wild having to produce patches from two versions of the object files), which would mean both that rustc is producing less LLVM bytecode and that wild gets to do what it (will) do best and make linking as fast as mechanically possible.
> This seems absolutely insane to me given how pervasive macros are in Rust
There was some work done on this front, but I haven't kept up to date on the current status of that. There was a PR showing promise <a href="https://github.com/rust-lang/rust/pull/129102" rel="nofollow">https://github.com/rust-lang/rust/pull/129102 (later landed as <a href="https://github.com/rust-lang/rust/pull/145354" rel="nofollow">https://github.com/rust-lang/rust/pull/145354, 10% on a specific serde-heavy crate, reports of 32% improvements in the original PR). The tracking issue doesn't have any updates <a href="https://github.com/rust-lang/rust/issues/151364" rel="nofollow">https://github.com/rust-lang/rust/issues/151364, but you can try out nightly with -Zcache-proc-macros to see what the effect could be on your projects.
Part of the problem I see is that crates will have to opt-in (and we might be able to change the default over an edition boundary) to get the perf benefit, and it might require a granularity lower than "a crate" (which would complicate implementation). I haven't seen additional discussions around these design considerations (needed to stabilize), which will need to happen before people can see progress.
Sadly, Rust is, like many open source projects, a show-up-o-cracy: you need a motivated (group of?) individual(s) to deliver a feature to fruition, and if the person driving a feature is fine with using nightly for their purposes, and only needs a subset of a feature, they will drive the feature to that state (lets say 80% completion), and then the feature will linger (until someone else with enough motivation to see the other 80% through shows up). This is exacerbated because the project is unwilling to have 80% solutions on stable unless the state is very clearly not going to preclude other future work, or the path to completion is 100% visible (but if that were the case, then it would have been completed already). So we end up with situations like the Allocator APIs.
nicoburns · · focus · HN ↗
> Another thing that can easily improve performance is changing the global allocator, but I've seen teams that measured 10% perf improvements in their own metrics decide against going with anything other than the "default".
Yeah, although I think there's more of a trade-off there. Alternative allocators can add significant amounts of compile time. Whereas, modulo maturity, I think a faster linker is more of a pure win. I would imagine we will make wild the default linker at some point if development continues on the trajectory it seems to be on.
dicytea · · focus · HN ↗
<a href="https://github.com/rust-lang/rustc_codegen_cranelift/issues/166" rel="nofollow">https://github.com/rust-lang/rustc_codegen_cranelift/issues/...
dabinat · · focus · HN ↗
jchw · · focus · HN ↗
I'd love something halfway. Go is maybe a bit radical in some regards, but also, with the news of the new SIMD package for Go, it has occured to me just how little I missed having things like, say, autovectorization.
oscillonoscope · · focus · HN ↗
pjmlp · · focus · HN ↗
Instead of Go, you could have reached out to complex languages with fast compilation times like D, OCaml, Haskell, Ada, Delphi, C++.
All of them have alternative implementations with fast compilation times.
D, use dmd for fast development workflows, gdc or ldc for the ultimate performance at the expense of compilation times.
OCaml, use the REPL or bytecode interpreter for fast development times, the full blow compiler for ultimate performance.
Haskell, use the REPL, GHCi for the fast development cycles, GHC for the release build.
Ada and Delphi, have had fast implementations since forever, although Ada/SPARK is indeed somehow expensive.
C++, yes it isn't a mistake. Use Live++, VS hot reload, coupled with binary libraries, or a REPL like CINT (nee ROOT), binary libraries for dependencies, incremental compilation and incremental linking for the development workflow.
The problem with Rust isn't the language itself, rather the ecosystem currently lacking such kind of options being available.
Shorel · · focus · HN ↗
[deleted] · · focus · HN ↗
[deleted]
slopinthebag · · focus · HN ↗
pjmlp · · focus · HN ↗
C++ game engines also don't need Bevy like tutorials, because most studios aren't compiling them from scratch, and tools like Live++ or VC++ hot reload are relatively easy to use.
slopinthebag · · focus · HN ↗
but hey, just add subsecond and switch to cranelift. problem solved :)
pjmlp · · focus · HN ↗
Many studios have delivered games with little to no changes to the underlying C++ code.
[0] - <a href="https://dev.epicgames.com/documentation/unreal-engine/using-live-coding-to-recompile-unreal-engine-applications-at-runtime" rel="nofollow">https://dev.epicgames.com/documentation/unreal-engine/using-...
slopinthebag · · focus · HN ↗
but when you do have to compile c++, it can be real slow. maybe not as slow as rust, but it's not in the same league as eg. go, c#, zig, etc.
ue5's hot reload is by no means perfect either - many gameplay code changes require recompiling the editor. exposing c++ properties on a blueprint? recompile. modify a constructor? recompile. changing parameters, return types, or adding/removing UFUNCTION or UPROPERTY macros? recompile. you can simply search the web to read the experiences of thousands of ue devs complaining about slow compile times and workflows. it's the same with unity btw, search "reloading domain unity".
also verse is not in unreal engine. no studio is using verse for ue games. not sure why you threw that in.
i get you love c++ and dislike rust, but you aren't really making a good case for c++ when you group it in with other languages that have fast compile times ootb, make arguments that involve not using c++ (like blueprints, lol), and rely on brittle third-party hot-reloading solutions.
pjmlp · · focus · HN ↗
No one is saying that C++ compile times are anywhere close to Delphi or D, although they are much better when using modules actually.
Rather that C++ ecosystem has a developer culture and tools, that makes compiling from scratch and pure distribution of source code for what is a compiled language, something rare, thus despite its slowness, the average impact is less felt than on Rust projects.
slopinthebag · · focus · HN ↗
modules? you mean the thing where 2/3 major compilers still only have partial support for? how many major c++ projects are using modules?
i get it, you hate rust.
pjmlp · · focus · HN ↗
Office has been using C++ modules for a while now, I think they are major enough.
Nah, I hate lack of tooling, you missed my other examples from languages in the ML family.
pornel · · focus · HN ↗
In unoptimized builds often the linker is the bottleneck. Rust/Cargo can parallelize most of the build, generating tons of code and debug info, but then the poor linker has to consume all of it at once. The object/exe formats were designed in ancient times, so they're hard to build incrementally or in parallel (some linkers are trying).
sigbottle · · focus · HN ↗
At least for the fully static binary part of rust, there should be some optimizations there w.r.t. compilation. Sure you're not going to interface with shared libraries well but maybe a small experimental feature for fully owned projects? Idk.
pornel · · focus · HN ↗
ABIs won't help automatically. The overhead comes mainly from generics and macros. Monomorphic generics and AST macros are impossible to express in an ABI. Turning them into polymorphic usually wouldn't remove the many abstraction layers that need to be peeled off, and only make them cost at runtime too.
So far MIR optimizations were helpful. Rust can simplify high-level MIR quicker than LLVM can simplify the same code after it's been lowered to lots of low-level instructions.
kreco · · focus · HN ↗
weinzierl · · focus · HN ↗
Both are kind of outside the Rust compiler's influence. Macros can be almost arbitrarily complex: you pay for what you order. Codegen is LLVM, and that's a fixed choice. You can use Cranelift to get around it, but then you pay elsewhere.
Regardless, it's nice to see performance improvements in the compiler, even if you have to cooperate to benefit from them (e.g. by keeping your macros light).
senderista · · focus · HN ↗
kibwen · · focus · HN ↗
applfanboysbgon · · focus · HN ↗
kibwen · · focus · HN ↗
Rust was originally a research language. It wasn't even clear that their primary three goals--"safe, concurrent, fast"--were simultaneously achievable to their desired degree. That it turned out to be possible was one of the most surprising and impactful results in the history of language design; even the early formulations of Rust assumed that both a garbage collector and a green thread runtime would be necessary, neither of which turned out to be true. That Rust could have faster compilation is both true and vacuous; there's always more optimizations to be eked out. The main question is whether or not significant performance wins could be gained by having made different, fundamentally-backwards-incompatible design decisions, and the answer is no, not really. Performance-related features like referentially-transparent procmacros can easily be made the default over an edition, and polymorphization can be implemented via an alloca-based virtual-dispatch ABI vis-a-vis Swift.
> Rust devs have talked about how they have some regrets about not optimizing more for compilation, but instead another attribute got optimized in terms of paretto efficiency - the language's development time.
No, the early Rust devs got this right. They were in fact highly incentivized to care about compiler performance, because rustc has been bootstrapped since 2011, making them the most serious users of the language in earnest (with the second-most serious users being the Servo devs one cubicle over). Rust spent years getting its basic design nailed down, then it did the hardest thing for any language: understanding the importance of shipping, resisting the urge to endlessly pursue perfection, and future-proofing what they could. Without shipping a useful language you can't get in the hands of users, and without getting in the hands of users you can't discover your most important flaws in practice. And because Rust shipped in 2015, it had ten years to hammer itself into shape to weather the agentic era; it could have easily still been on version 0.113 by now, puttering around in an ivory tower with no commitment to stability and no real users to give feedback.
pjmlp · · focus · HN ↗
Since the 2000's we have been on the wrong path, many developers kept reaching for C and C++, not because they needed the actual features of a systems programming language, rather they didn't knew anything else that would ahead of time compile to native code, or even if they did the mindshare wasn't relevant for them.
Now thankfully we are circling back to how it should have been all along.
However all of this might be meaningless in the age of AI driven programming, where developers have no clue if the agent is driving automatic or stick, while delivering on the Markdown file plan.
jiehong · · focus · HN ↗
Zig and Go are similar on that front.
pjmlp · · focus · HN ↗
This is really nothing new, the visibility problem is that many developers only know C and C++ as how long compilers take.
adamch · · focus · HN ↗
bryanlarsen · · focus · HN ↗
Sometimes we really can have our cake and eat it too.
maherbeg · · focus · HN ↗
OG_BME · · focus · HN ↗
<a href="https://forge.rust-lang.org/policies/llm-usage.html" rel="nofollow">https://forge.rust-lang.org/policies/llm-usage.html
poly2it · · focus · HN ↗
<a href="https://forge.rust-lang.org/policies/llm-usage.html#experiment-llm-created-code-changes-intended-for-review" rel="nofollow">https://forge.rust-lang.org/policies/llm-usage.html#experime...
sigmar · · focus · HN ↗
>I’m still writing all my own code and text, because (a) that’s paramount, and (b) the project policy requires it, but I had useful LLM analysis assistance on several of the PRs mentioned in this post.
from the article
echelon · · focus · HN ↗
Rust is the best language to serialize agentic LLM output to. It's native, well constructed, low-defect due to design. It's also easy for humans to read and debug if necessary.
The biggest problem with Rust is the compile times. The cycle has to get faster. And we need to start thinking about making the artifact cache non-blocking so multiple agents can work simultaneously - that'll be a big task, but essential if we want to speed up work on one machine rather than spinning up clusters of agent sandboxes (the alternative, perhaps superior solution).
Aurornis · · focus · HN ↗
OpenAI also hands out free subscriptions to open source maintainers: <a href="https://developers.openai.com/community/codex-for-oss" rel="nofollow">https://developers.openai.com/community/codex-for-oss They're time limited for now, but they've been pretty generous about who gets them. Anyone who can show Rust contributions would have been able to get one before.
rirze · · focus · HN ↗
jodrellblank · · focus · HN ↗
Or in software terms, BigCorp sponsors you to develop an open source tool fulltime. If you make the tool more useful for them while making it more complex or worse or ignoring things for others, they might fund you next year as well. If you don't, they might stop and you need to get a normal job instead. What are you incentivised to do in this situation?
tancop · · focus · HN ↗
The only times this actually happened are C++ and CORBA as far as I remember. Both of them were bureaucratic design by committee efforts from the start, the people doing it weren't users but implementors looking to stop competition, and it all happened before the open source era.
pjmlp · · focus · HN ↗
maherbeg · · focus · HN ↗
silverwind · · focus · HN ↗
nicoburns · · focus · HN ↗
godwinson__4-8 · · focus · HN ↗
What you suggest may thus be more or less already happening.
hnp9j9qtda · · focus · HN ↗
clarus · · focus · HN ↗
rapind · · focus · HN ↗
geauxvirtual · · focus · HN ↗
Splitting out a project into multiple crates reduces what needs to be recompiled during development. I tend to break out areas of my application that aren't going to change regularly so I'm only having to rebuild the main application.
In a production scenario where you're probably building your application in some CI environment, unless you cache the release build artifacts to re-use when applicable, the entire project will be rebuilt every run.
rapind · · focus · HN ↗
ddalcino · · focus · HN ↗
slowin · · focus · HN ↗
echelon · · focus · HN ↗
I've stopped using Tauri and gone with 100% egui. It's cross platform and excellent, and if you give it design constraints it will look beautiful.
Check out my 100% adobe clean room reimplementations:
<a href="https://github.com/storytold/filmcraft" rel="nofollow">https://github.com/storytold/filmcraft
<a href="https://github.com/storytold/photocraft" rel="nofollow">https://github.com/storytold/photocraft
<a href="https://github.com/storytold/drawcraft" rel="nofollow">https://github.com/storytold/drawcraft (going to rename this vectorcraft)
The #1 thing for the Rust project to do is make Rust faster to compile.
Rust is the agentic AI language. It just needs to lean in and go faster.
tcfhgj · · focus · HN ↗
#0 get rid of the orphan rule
Quitschquat · · focus · HN ↗
estebank · · focus · HN ↗
Some people propose relaxing this rule for "workspaces" (local projects with multiple crates that are not published individually). I haven't researched whether that would be technically feasible.
echelon · · focus · HN ↗
Workspaces are a great way to architect larger projects and monorepos, and they'd at least be internally consistent.
mrkeen · · focus · HN ↗
panstromek · · focus · HN ↗
Nevertheless, people in the project are trying to figuring out a way to relax the rule while still maintaining coherence, so this might happen some day.
cztomsik · · focus · HN ↗
BTW: cheers, we should grab a beer some day :)
panstromek · · focus · HN ↗
the_sleaze_ · · focus · HN ↗
slowin · · focus · HN ↗
xutopia · · focus · HN ↗
jlahijani · · focus · HN ↗
mixmastamyk · · focus · HN ↗
nonethewiser · · focus · HN ↗
echelon · · focus · HN ↗
Going to do Toon Boom and a few others too and build them as a suite.
pjmlp · · focus · HN ↗
echelon · · focus · HN ↗
pjmlp · · focus · HN ↗
shirol · · focus · HN ↗
I'm normally against fully vibe-coded apps, but at this point, I'm just impressed.
krapp · · focus · HN ↗
At some point we have to move on from amazement at what these models can do to actually caring about the quality of the product.
throwaway27448 · · focus · HN ↗
Bolwin · · focus · HN ↗
GuB-42 · · focus · HN ↗
Rust is built on the idea that code that compile must be correct, to the best of its abilities. LLMs are fast and sloppy, Rust keeps them in check by not letting them get away with preventable bugs.
Of course, Rust can't do anything for spec bugs, like making the stop light green when it should be red, but it can help with crashes and vulnerabilities.
wannabe44 · · focus · HN ↗
1. <a href="https://www.phoronix.com/news/Ubuntu-Rust-Coreutils-Audit" rel="nofollow">https://www.phoronix.com/news/Ubuntu-Rust-Coreutils-Audit - file system and OS aren't always neatly represented in tYpE sYsTeM.
2. <a href="https://blog.cloudflare.com/18-november-2025-outage/" rel="nofollow">https://blog.cloudflare.com/18-november-2025-outage/ - bad programmers can write bad code in any language.
3. <a href="https://blog.rust-lang.org/2026/08/20/supply-chain-attack-on-arrayref/" rel="nofollow">https://blog.rust-lang.org/2026/08/20/supply-chain-attack-on... - the culture of trusting random strangers logging in through GitHub without even 2FA is concerning too.
If we compare open issues in comparable rust and Go software (eg: sharkdp/bat vs sharkdp/fd) one would find there's no persisting pattern where rust is better.
GuB-42 · · focus · HN ↗
The result is a large amount of high quality code a LLM can train on. Compare to Zig for instance, which is a fine language, but not as popular so lacking in volume for good training. You then can understand why Anthropic ported Bun from Zig to Rust if they intend to vibe code. Languages like PHP, while actually quite decent today, have a long history of terrible code, so not great for a LLM as most of its training dataset is poisoned.
The unfortunate part is that it may not last. If Rust becomes the de-facto language for LLM production, overall quality may decrease. It is a common problem with many machine learning techniques including LLMs: feeding them their own output tend to decrease quality.
jeroenhd · · focus · HN ↗
LLMs do trip up when they generate Rust code, but they also do when generating any other language. The big difference is that the Rust compiler refuses to compile broken code faster, whereas Go will just let you SIGSEGV on edge cases without warning.
The recent TLA+ hype here on HN shows that Rust may just be the beginning here. There are valid, safe Rust programs that will crash, the language isn't perfect. The older languages with more math and validation behind them (Ada?) are probably even better suited for generated code, but they don't have the hype culture to capture mainstream attention (and even fewer people have the ability to really review that code).
There's an alternative solution of course: use platforms like JS/.NET/JVMs/Python to run code that cannot violently crash because of the language runtime around it. That comes with a performance overhead but it's good for prototyping without as many stability footguns and with faster compilations.
mkesper · · focus · HN ↗
dmead · · focus · HN ↗
Aurornis · · focus · HN ↗
Incremental changes in a normal project shouldn’t cause massive compile times. Even for my large projects, the compile times are trivial compared to the duration of an LLM turn.
Very large projects should be broken into logical modules so only the changed part is incrementally compiled. If linking is taking a long time there are alternate linkers that can be used.
If you’re using work trees a lot, set up compiler caching to avoid rebuilding everything from zero on every new work tree is important.
I know these things are frustrating to new Rust users who just want everything to be automatic and easy, but if we’re talking about LLM development anyway then these optimizations would have come up the first time you asked your LLM what could be done about improving compile times. LLMs are very good at setting up these optimizations.
asutekku · · focus · HN ↗
Aurornis · · focus · HN ↗
What kind of work are you doing where the LLM turns are only taking "seconds" and it's recompiling all the time?
This morning so far my LLM rounds have taken between 10-15 minutes. An incremental compile happens a couple times at most.
Even on the largest Rust codebases I've been working with (OSS projects), incremental compiles are not taking multiple minutes unless I do something that triggers a full recompile.
mattz56 · · focus · HN ↗
[dead]
flipping_beacon · · focus · HN ↗
s08148692 · · focus · HN ↗
Most projects my fleet works on are in other languages (TS, Go, Elixir) and can comfortably handle 10+ agents working in parallel, but not rust. I had to cap the fleet to 5 workers and build a dedicated resource monitor to step in and tidy up every time the disk almost filled up
That and general progress on building is far slower, with far more time spent building and testing than any other language I use.
Ended up rebuilding in Go, the perf gains weren't worth it
slopinthebag · · focus · HN ↗
paholg · · focus · HN ↗
<a href="https://github.com/mozilla/sccache" rel="nofollow">https://github.com/mozilla/sccache
pjmlp · · focus · HN ↗
dwattttt · · focus · HN ↗
Aurornis · · focus · HN ↗
There's a new project called kache <a href="https://github.com/kunobi-ninja/kache" rel="nofollow">https://github.com/kunobi-ninja/kache that takes this even further and handles more edge cases with worktrees, but it's newer.
If you were pulling the entire project fresh and rebuilding everything in every worktree all the time without any caching then it would be frustrating. You could have asked your agent to set up basic caching and solved most of your problem in minutes.
slopinthebag · · focus · HN ↗
jiehong · · focus · HN ↗
gpm · · focus · HN ↗
Aurornis · · focus · HN ↗
Doing 10 separate clean builds to work on 10 things at the same time wasn’t a consideration until very recently.
npalli · · focus · HN ↗
[dead]
jarjoura · · focus · HN ↗
Rust is what you use when you want to maximize on the runtime performance. It will build software that requires significantly less memory and maximize the CPU that will save time and energy. It's a system language for writing software meant to access the hardware.
ameliaquining · · focus · HN ↗
virtualritz · · focus · HN ↗
Cargo run/test/nextest/run only, check/fmt etc should be excluded.
This avoids contention/oversubscription of the CPU which makes builds up to 300% slower from what I measured.
jbellis · · focus · HN ↗
My harness control plane will autoconfigure mbx across all your machines, if you like. <a href="https://github.com/BrokkAi/mjolnir/" rel="nofollow">https://github.com/BrokkAi/mjolnir/
muthuh · · focus · HN ↗
knuckleheads · · focus · HN ↗
embedding-shape · · focus · HN ↗
knuckleheads · · focus · HN ↗
embedding-shape · · focus · HN ↗
knuckleheads · · focus · HN ↗
knuckleheads · · focus · HN ↗
Headstart on codex-rs (16 cores, clean builds, median of 3 alternating off/on pairs):
Not helpful for compilation yet, but it's something :)hensenjuang · · focus · HN ↗
[dead]
knuckleheads · · focus · HN ↗
yearolinuxdsktp · · focus · HN ↗
Incremental compilation is not cleaned up. Older deps pile up and don’t get cleaned.
Run out of disk space? Oh it’s just the 200+ GB codex-rs target folder.
Forget about doing worktrees.
Rust has a lot of work to do.
ninkendo · · focus · HN ↗
yearolinuxdsktp · · focus · HN ↗
ninkendo · · focus · HN ↗
WalterBright · · focus · HN ↗
nicoburns · · focus · HN ↗
Linking is normally slower in debug btw (because of the debug info)
khuey · · focus · HN ↗
kibwen · · focus · HN ↗
Let's compare. I just checked out ripgrep and built it and all its dependencies from scratch. Total time to produce a debug build: 6.92 seconds. This is inside a 16GB VM on a random Linux laptop (on battery); no beefy hardware here.
Let's try something beefier. I just checked out uutils (an implementation of coreutils) and built it from scratch. Total time to produce debug builds, for eighty binaries and all their dependencies: 30.26 seconds.
Let's try something beefier. I just checked out Servo, an entire browser engine, and built it and all its dependencies from scratch. Total time to build and link its one-thousand one-hundred and ten compilation units (along with its infamously huge and serial servo-script bottleneck) into a binary: 4 minutes and 38 seconds.
If Codex takes 45 minutes to build from scratch, that's an indictment of OpenAI and their development processes.
surajrmal · · focus · HN ↗
kibwen · · focus · HN ↗
je42 · · focus · HN ↗
surajrmal · · focus · HN ↗
embedding-shape · · focus · HN ↗
ninkendo · · focus · HN ↗
scrubs · · focus · HN ↗
The zig compiler apart from a couple of cross build or linker issues is darn good. Switch to rust is a function of library support, private struct fields. Rust itself is better organized and far better documented compared to zig.
However, rust has got to get their allocators for container support straightened out soon. I do SAAS for fintech and low level packet transports. Both benefit greatly with allocators custom designed for job at hand.
45 mins strikes me as something else is amiss ...
NobodyNada · · focus · HN ↗
Good news: <a href="https://github.com/rust-lang/rust/pull/156882" rel="nofollow">https://github.com/rust-lang/rust/pull/156882
The allocator API has been stabilized, to be released in Rust 1.100 in November. (Though only Vec and Box will support custom allocators immediately; the rest of the standard library collections are coming later.)
JoshTriplett · · focus · HN ↗
How much memory do you have, and do you have swap turned on?
I have 32GB of RAM, and it barely manages to build release if I shut down everything else on the system that uses RAM. 64GB would be better. If you have 32GB or less and you have swap on, the performance might be mostly because you're spending a lot of time swapping. And that's for release; debug on a repo that size may spend a lot of time and memory linking debug info.
lr1970 · · focus · HN ↗
embedding-shape · · focus · HN ↗
surajrmal · · focus · HN ↗
mort96 · · focus · HN ↗
embedding-shape · · focus · HN ↗
... But the whole point is that that project is big, unwieldy and has lots of crates, both their own and 3rd party. Slapping a cache in front of it kind of defeats the purpose here, to see how parent's thing would speed things up for really large projects.
panstromek · · focus · HN ↗
We have discussed this briefly on last All Hands, the problem will probably be dealing with compiler errors, when they happen in builds that already emitted metadata. I believe this was the reason why it wasn't merged in the first place.
knuckleheads · · focus · HN ↗
I view this as speculative execution/compilation and just throw out any errors from a crate that depended on another crate that ultimately errors out. It has the same outcome (same errors are printed in both cases) you just have a chance of having totally wasted some cpu time (that was otherwise just sitting around though).
knuckleheads · · focus · HN ↗
^ run setup and give it a whirl. Will send to Rust compiler team when I have some pr's up etc.
randypewick · · focus · HN ↗
I can't find that talk again, but it was quite interesting: the rust compiler is fast, but often times it has to perform a lot of unnecessary checks because crates contain more stuff than needed. By stripping unnecessary work, the makepad team made building pretty fast.
dabinat · · focus · HN ↗
But the real speedup will happen when TPDE is enabled: <a href="https://goals.rust-lang.org/2026/tpde.html" rel="nofollow">https://goals.rust-lang.org/2026/tpde.html
1vuio0pswjnm7 · · focus · HN ↗
Is it slower
simonask · · focus · HN ↗
In practice, C++ and Rust feel pretty similar, mostly due to the kind of code people tend to write in both languages (favoring static dispatch, generics/templates, etc.).
pjmlp · · focus · HN ↗
Compilers for languages like BASIC, Delphi, Eiffel, Modula-2, Caml Light, Oberon, Clipper, COBOL, were running circles around C compilers back then.
1vuio0pswjnm7 · · focus · HN ↗
sharktheone · · focus · HN ↗
jongjong · · focus · HN ↗
- Raw performance doesn't actually matter for the vast majority of use cases. Performance does not equate scalability. Moreover, differences usually disappear in practice once you've actually developed the software because time and storage complexity of operations usually dwarf constant resource costs. Furthermore, do you realize how much more computational resources AI uses compared to a classic piece of software? Trying to optimize tools in the age of AI is like putting lipstick on a pig.
- It's more verbose than most other languages; waste of tokens, context window, time and AI reasoning capacity. The strain most devs feel when reading Rust, also impacts LLMs. It obfuscates essential logic and replaces it with ceremony.
- The Rust training set is far smaller than other popular programming languages. It's also quite different from other programming languages so it probably doesn't benefit as much from cross-language patterns; in fact, could be problematic.
- You have to wait for a compiler; more wasted time which the AI agent could have been using to write code.
It's like TypeScript. Devs became obsessed with TypeScript. Everyone was sure that it would be better for AI. Not the case. LLMs essentially never make type errors in JavaScript (or TypeScript). Static typing is completely redundant. These are the most trivial kinds of errors to avoid. Seriously, try Claude with vanilla JavaScript on Node.js. TypeScript is worse with AI because people who used it tended to over-engineer, also a lot of TypeScript is ceremonial and performative complexity intended for a bureaucratic audience; those are the main patterns which AIs picked up from their training set.
Seriously, try working with a TypeScript codebase and notice how Claude invents all these contrived abstractions, spread out over a huge number of files with unclear separation of concerns and full of lengthy, highly contrived comments.
It's the same issue with all these over-engineered languages which were developed for people who were not good at coding and needed a whole bunch of extra safety features in order to produce functioning software. It's like training wheels on a bike; great to learn in the early stages but if you want to learn how the pros do it, you've got to look at the people who compete in the Olympics; and note that there's a reason none of them still have training wheels on their bikes!
pjmlp · · focus · HN ↗
I rather have the option of Swift 6, Linear Haskell, Koka, OxCaml, Scala 3, and co.
Have automatic resource management as default, with additional type system abilities for low level coding.
blandflakes · · focus · HN ↗
vor_ · · focus · HN ↗