Hacker Newsnew | past | comments | ask | show | jobs | submit | jadbox's commentslogin

Is the compiler any faster now? Compiling takes forever. I'm also tired of always having to do "cargo clean" everyday to clear out 90gb of temp files.

Faster compile and smaller build-dir can be at odds with each other.

That said, this release includes some incremental improvements as well as the unused-dependency lint to help reduce wasted work within the ecosystem.

Some changes that have been or are about to be merged for upcoming releases

- We will be reducing the debug info generated for the `dev` profile which reduces build-dir size and speeds up builds. We've split off a `debug` profile for when that is needed.

- Cargo will be deleting the directory rustc writes before each invocation, avoiding the leaking of debug files when split-debug is enabled (default on Mac)

- rlibs for workspace members will no longer be copied from build-dir to target-dir which takes up extra space on systems without hardlinking or where we skip it (like Mac)

- redundant information in rlibs and rmeta's is going to be de-duplicated

Examples of further out changes

- This release includes the foundational work to add a build-dir GC

- Cross-workspace de-duplicating of build-dirs

- Cross-workspace build-dir cache

- Early cut off



Note that this is a special form of early cut off (which was listed) where you are hashing a more specialized output file, rather than a broader one.

Ive always wondered why this wasn't an option from the beginning

To do it right you need

- stable id's even when the source changes

- a separate output file dedicated to it so you hash that

Those aren't free, taking extra work to implement and possibly slow down the compiler


Thanks for the list, looking forward to those improvements.

Compiler speed is continually being worked on https://nnethercote.github.io/2026/11/04/how-to-speed-up-the...

And the large target directories is also being worked on as well.


I think the main reason Rust gets a bad reputation for compile times is that the compiler makes it very easy to shoot yourself in the foot. When I first started using Rust my compile times for release builds were around 7-8 mins. Then I tweaked some settings and split things up into smaller crates and got it to be under a minute, which was fine for me.

cargo check would still take a long time though, until I realized that I had a build script that was triggering more often that it should, causing Rust to throw out a lot of its work and redo it. Once I fixed that, cargo check was near-instant.

So as a Rust developer you can have decent compile times but only if you (and your dependencies) optimize for it. Hopefully at some point we’ll be able to stop having to think about it, but we’re not there yet.


Do you have an example of some of the compiler/setup changes you made, besides just splitting things into smaller crates, or was that all the organizational changes you made?

Yes, lots of optimization work has it made faster despite gaining new features.

https://perf.rust-lang.org/dashboard.html


Yes this is why I switched to Go for backend, much faster compiling and performance isn't an issue for the application yes using 100GB+ is just bad tooling.

Not only is the compiler very slow, but maintaining the code is slower too. No single tool is right for everything. To me, Rust is definitely not a general-purpose language. It only makes sense for workloads where the ratio of execution time to dev/compile time is heavily skewed toward running the code.

Nah, compared to other languages, the strictness of Rust makes maintaining codebases a joy. Like, I love Python, but maintaining a large Python codebase is a source of constant anxiety. The Rust compiler actually feels like it has your back.

Any faster vs what baseline? They’ve constantly made improvements and Rust today is pretty darn quick, especially for incremental. There’s work to parallelize the front end which will help a little bit and you can always use the cranelift backend for debugging which is substantially faster than LLVM.

They’re also doing work to reduce the amount of disk space usage (by clearing out unused articacts) and make it easier to maintain.


Best to do some benchmarks for cranelift on your codebases and system. It used to be quite a lot faster, but for me the advantage has disappeared over the last year of Rust improvements.

Compiler usually isn't the problem, it's the link stage. Try "wild" linker (it's amazing) and try looser release-like build profiles

You might be interested in this: https://news.ycombinator.com/item?id=50458849 - I didn't try it yet, though.

On macOS there is a known bug where some temp files are always created anew, not reused, which slows down compilation and wastes more space than other platforms.

Do you have details? I think I'm running into this.


Fixed on nightly.

try disabling at least some debug-info for your dependencies.

use cargo's --timings option to identify the slow crates, then use measureme to figure where rustc is spending time.

try fiddling with detached debug-info, dwp files can be smaller than their constituent dwo files.

ensure really small "template wrappers" are inlined.

lower the number of compilation-units you use.

For incremental builds I have found it can _sometimes_ be effective to split out larger dependencies into a dynlib. You create a dylib crate that re-exports said dependencies and your executable depends on that. Ofc things like generics from the offending libraries will still end up in your executables; Though I think there is a way to mitigate this a little.

This mostly helps with link-time, and saving space if you have a bunch of executables (using the argv[0] trick will help more, though).


All the big AI companies use Rust so this is probably something they should focus on improving.

They do fund some of these efforts, yes.

I don't understand why people complain about this non-stop. If compilation time is such an issue use a different language. I can't say I've been bottlenecked by compilation in a very long time.

I don't think you can tell people not to complain about it - it is clearly very desirable to have faster compilation, like Zig or Go.

But that said I do agree it is pretty fast these days. Significantly faster than C++ and people have tolerated that for decades.


I didn't tell anyone to do anything. I just don't get why people complain—it's like they don't grasp the concept of tradeoffs.

Is the compiler any faster now?

If your codebase is not some small project, its excruciating slow. Even if you try different linkers, and other compilers, nothing really make incremental compiles eat so much of your system. Even more so if you have multiple AI agents doing security and other checks.

Switched to Go for several months, and the difference was very noticeable. Until you started to get there also 50k+ files that are interlinked. And let us not talk about Go and Rust their issues with insane amount of debug/cache buildup.

Imaging if you have 4 to 6 agents running that, with each seeing the cache grow from 20, 30, 40 ... To the point that a 100/1000GB SSD grows to 800, 900GB usage. Often in barely a day.

Seen my NVME drive its lifespan drop from 98% to 91% in barely a few month time. I dread looking at it again lol

What was the solution? Going back to C ... Despite right now working on a 800k lines project, it compiles way faster the Go, and well, Rust will have pegged all 16 cores for a minute, for EACH agent trying to recompile on a small change.

Memory safety? Instead of checking at compile time, and wasting my time, this has simply been moved to AI agents checking, making tools, checking, at night. So it does not disturb my own work.

Its ironic, how both modern projects, end up being worse off. Best of all, the C project is way faster then the same project in Go and Rust. Yea, it was "fun" having AI transcompile them twice but the difference on actual large codebase, and not some micro benchmarks is not a joke. To the point that now all my projects have gone back to C...

And yea, i expect some fast downvotes by our Rust friends because saying something negative about Rust always gets people downvoted here. No offence but Rust being linked to LLM and the whole checker was a benefit before AI came around. But now you can offload a lot of safety checks to the backend/offhours, instead of paying for it with every compile.


IME you're optimizing for the wrong thing and are taking myopic and short-term-pleasure measures.

I too grind my teeth when programs are slow, especially compilers, but Rust has saved my hide enough times that I accept the slowness of the compiler / linker stack as a necessary price for the peace of mind once the program runs in production.

Plus, they're working on it all the time. Too slow for my taste? Definitely. But it's still okay.

...And stop blaming downvotes on Rust criticisms. You're 10x more likely to get downvoted for attacking an imaginary group or generally sounding like you're flaming.

I found your comment interesting almost until the end, and then I rolled my eyes hard at the final part. Just don't. Keep criticisms informed and you'll get much more interesting replies and reactions.

Seriously. Try it.

(And don't double down on a victim complex either; i.e. your smaller comment under the bigger one.)


Thanks for proving my point. Every time there is some criticism of Rust, some people can not help downvoting because they associate their being with a programming language. Such odd behavior...

I downvoted this post for complaining about downvotes, and, after you called attention to it, went back and downvoted the previous post for preemptively complaining about downvotes. Hope that helps.

What the hell are you doing to produce 90gb of temp files? Is that normal on rust land?

It's large but not insane. I've got 20gb in a not-too-large repo.

That is frankly insane IMO. 20 MB would be insane unless there's massive libraries or something. 20 GB is the size of a very fat graphical operating system.

Exactly, yes. My project uses a GUI framework developed as part of a graphical operating system written in rust. Cargo fetches quite a big subset of that graphical OS in order to build this dependency, which is statically compiled into my app.

It’s Windows 10 install storage requirement.

I think even Gradle produce much less cache files...

I thought the same thing. My current Gradle cache folder sits around 6GB and it includes cache from around 20 to 40 projects, including different wrapper versions.

No. My target directory is 329GB at the moment. I wish mine were just 90GB.

(And yet I’m perfectly happy running `cargo clean` periodically in exchange for all the Rust loveliness. Sure, I wish I didn’t need to. Sure, I hope it’ll get better. I can live with the temporary inconvenience though.

Also, I’m developing in a tight auto-build-on-commit loop so I have a gazillion builds.)


Yea, I was thinking the same. 90gb is not that big. Last week I cleared 130gb out of the target dir.

These numbers are totally insane. I've never seen a Rust project with a build cache this large.

Do you have 10 different versions of Tokio included in your project or something?

The project I'm currently working on is quite large, and it's locally cross-compiled to 5 different arch/OS combinations, plus a debug build for the local machine. The build dir is 9.1 GB. I've seen it grow to somewhere around 20 GB, but only after a significant number of dependencies were updated, or the compiler version changed.

A clean debug build of Bevy (a game engine, one of the largest Rust projects around) produces a target dir of around 13 GB. By the way, rebuilding Bevy on my machine takes about 1 minute.

Now, these numbers are still much bigger than I would have preferred, but 329 GB? Get out of here.


i had a bevy project with a +500gb build folder. i occasionally get out-of-memory warnings and that reminds me to run cargo clean

but i think this is a macos-specific bug that is getting fixed


329gb?? That is larger than my entire SSD storage.

It would be more believable if you told me you were making your own GTA VI


Well, the AI that slops out Rust code won't mind having to wait!

[flagged]


That's not a paradox, that's how it always works. Compiling to fast machine code requires more work and takes longer.

Is Python a fast language because it barely takes any time to compile the code? No obviously not.


Looks like people extending rust never really focused on compile speed when designing features (from [1]):

> If you could reinvent/change any aspect of Rust, what would you do alternatively?

> A lot happened because we wanted to ship a useful thing with only so much time in the day, so some things were less deliberate than others. There’s an alternate version of Rust with significantly faster compiler times, because while we cared about compile times when designing we always prioritized other values more. We never asked ourselves how this feature or implementation impacted compiler analysis time and there are several spots where something slightly different would have much faster compiler times, which people do care about. But had we spent time on that, we would have neglected other things and not been any more successful.

[1]: https://alexalejandre.com/interviews/interview-with-steve-kl...


You missed "without optimizations on".

This is important, because most often during development you want fast compilation times more than you want fast code.


That still isn't a paradox. Furthermore it still makes sense: a language designed to generate the fastest code has constructs that cannot be compiled quickly, even without optimizations.

But some of it is implementation problems.


Rust's compilation speed issues are not due to optimizations. There is some intrinsic slowness, but also some boneheaded decisions that are now baked in. E.g. the unit of compilation being the crate, not file/module, makes it so you hit some bad scaling laws. And the borrow checker is SLOW, and unavoidably so, but borrow checking could have been avoided with different lifetime rules. Etc.

I say this as a full-time rust developer btw.


> And the borrow checker is SLOW, and unavoidably so

IIRC for most codebases borrowck actually makes up a pretty small proportion of compilation time (e.g., see [0] for some admittedly rough estimates).

> but borrow checking could have been avoided with different lifetime rules.

I'm not sure you could entirely avoid borrow checking without a pretty significant change to what you're allowed to do with references.

[0]: https://kobzol.github.io/rust/rustc/2024/03/15/rustc-what-ta...


Rust is indeed not designed for quick compilation. Furthermore and unlike what you said, what makes it memory safe has pretty little to do with that. But what makes it fast definitely has to do with that, which is what I said.

Rust encourages a kind of generic programming that can result in generating too much code.

The compilation model is vastly, vastly, vastly better than languages like C++ and C, though, and it does compile much faster than an equivalent C++ build (doesn't count if you download precompiled binaries of your c++ dependencies)


But the lack of ABI stability means that's not a choice anyway, doesn't it?

Rust can compile to dynamic libraries. If you don't use the C abi you have to compile anything that loads them with the same Rust compiler version and target triple. So you need to have some way to guarantee the correct compiler is being used, e.g. Nix or Bazel.

And possibly compilation options?

There's no paradox here. You can use any benchmark you like to prove that Rust is a fast language. The work that the compiler does is irrespective of the language that rustc is written in.

Yes, the benchmark is compiler compiling itself. From scratch and incrementally.

Unfortunately, that isn't how any of this works.

Have you been similarly confused by how slow compiling can be for massive C++ projects for decades? I have trouble believing that you genuinely think that's what anyone means by saying Rut is fast.

In C++ case usually is the outcome of compiling everything from source, not using binary libraries for dependencies, binary caching, pre-compiled headers, incremental compilation and linking.

Some of the items tend to be rather sub-optimal in UNIX based C++ compilers.

Using Visual C++ or C++ Builder with pre-compiled headers, or modules nowadays, working only on the main application, with everything else compiled as DLLs, COM, or packages (C++ Builder specific), incremental compiler, incremental linking, hot code reloading, is rather fast for the typical compile-debug-fix workflow.


The comment I responded to said "Rust claims to be a fast language, but compiling, even without optimizations on, takes ages". I agree that if you skip compiling and just reuse stuff that was already compiled, then the time it takes to compile C++ is fast, but that's not really what was being discussed.

> Rust claims to be a fast language, but compiling, even without optimizations on, takes ages ...

As usual, this begs the question of "compared to what"? "Fast" languages obviously don't have some magical ability to guarantee that every program written in them is Blazing Fast(tm); without further inspection one can come to any number of other equally plausible conclusions (e.g., the program is fast for what it does).


What does this even mean


It means what it says


Publicly announcing they don’t know the definitions of words is a part of the humiliation fetish lol


Slavoj Zizek would like this joke I feel because of the lack negativity: a person in the crowd effectively declares their individuality by claiming (in Zizek's way) "I would prefer not to be an individual."

However a Lacanian critique would be that the crowd lacks knowing what their higher desires should be, so they create a sudo desire of freedom without the self exploration of what they desire to be "free for". Zizek touches on this point too that freedom requires self understanding on what you want to be responsible for: to be free is to know what is your calling beyond yourself. Without knowing your calling, freedom is either just boredom or blindly following the desires of others.


sudo is pseudo for the readers. A fake desire of freedom.

For some content, it isn’t just freedom the requires self-awareness, any sort of sustained action requires self-awareness to have any sort of coherence. I mean some things don’t need coherence, you could just instinctively take care of others without much deep semantics.

You can respond in a way you find fulfilling to each moment without knowing some grand unified sense of calling, or with only a vague description, “enjoying existence and helping others as you can to enjoy existence.”


> sudo desire of freedom

i think there's a chron job that runs that when you hit puberty.


"Who was Harry Brownstone?"


I don't think this model supports video yet btw. At least it doesnt work with the API yet.


That's really interesting I think- literally putting the layout into ascii language to reason about.


What's wrong with NodeJS or Bun?


NodeJS has just a long history of mistakes and stubbornes. CommonJS, node_modules mess, hostility against standards, low attention to performance just to name a few. Only recently they finally decided that TypeScript is fundamental, they are what is wrong in the JS ecosystem. I don't hate Bun, but it could've been just a slightly better NodeJS they don't solve fundamental issues like Deno has, so I don't like it. I'll just try as much as I can to wrap/hide NodeJS in my toolchain.


Why use Polars over just postgresql or sqlite?


It is optimized for analytic workloads (default in-mem columnar layout), whereas PG and sqlite are OLTP DBs. It's going to be insanely faster for those use cases.


And with DuckDB?

DuckDB is an in process OLAP, I’ve been using it a lot, and I am keen to use Polars but DuckDB seemings to be flying for me.


I like Polars’ syntax, a lot of times its dataframes API is much nicer than SQL.

It’s much more similar to cleaned up Spark syntax vs Pandas’ strange API.


I’m quite happy with things taking 3 minutes instead of an hour or so.


Actual databases pay up to two orders of magnitude of speed for durability. If you can regenerate your dataset in case the DB drops it (or there is a power outage, or whatever), being able to complete a complex, write-heavy query in 10s instead of 15 minutes is actually very useful when doing analysis.


Because those are databases? Polars is a data processing engine, not a database. They have different uses.


If you want to use a database instead of Polars, for similar use cases, duckdb is a much better bet than postgressql or sqlite.


Lee Smolin a few years ago wrote a paper on quantum neuron plausibility: https://arxiv.org/html/2001.08522v1


Gemini 3.8 Flash looks like its better than v7 Luna/Sol on DeepSWE v1.1 while at $0.75 per million input tokens and $3.75 per million output tokens. Luna is much cheaper, but Flash has nearly Astra's performance for under the price of Sol ($2/$10).


Flash thinks much more so it’s pretty much line with Sol for performance. That said I like flash coding style much more than OpenAi models.


out of curiosity, what type of code/language do you usually use flash to write?


I use it for golang, and it is fantastic. Incredibly fast. It seems the llm and I “understand” each other. I have to be less careful in my exact phrasing. It kind of just does what I want and expect.

When I ask for an explanation it adds the right amount of detail. Of course, some of the material is new to me so subtle errors are hard to spot. But at least I’ve caught Terra and Sol on inconsistent messaging.

Also I’ve found 3.8 flash to circle back to root issues even at the conceptual level like problem fit and conceptual solution direction or architecture when I wasn’t achieving my goals. It flat out said I was attempting to use the wrong tool. Whereas Sol and Astra kept rabbit holing and looking for tiny implementation errors. Even after prompting them specifically to look at it broader.


what harness or plan are you using 3.8 flash with?


I’m using antigravity. I’m still on the AI Pro plan for the promotional $5/month.


where is this promotion?


If you don’t have a plan yet, log in to antigravity. There will be a button “upgrade plan” somewhere. Sometimes it pops up and otherwise lookup in settings > account. There should be some button that says upgrade. Clicking that brought me to the google studio ai page which offered the 20-something plan for €5/month.


anti-gravity with gemini 3.8 or gtfo


Gemini 3.8 Flash and 3.1 Pro are pure rubbish. Very little thinking, mediocre and usually incorrect results. They cannot be compared to frontier models.


This is my experience as well. I am surprised that lot of people find it much better than Luna.


I suspect that the people saying this haven't used Luna.

It's also weird that anyone uses it outside of an enterprise. They force you to use Googles inferior harness on the plans and I doubt any mere mortal is paying that much, for so little usage, with the worst harness on the market.


I prefer 5.6 Luna while a coworker prefers 3.8 Flash. The difference seems to be that they chat with Flash (with code context) while I just ask Luna to directly modify the code. I was already very impressed with 5.6 Luna so I am looking forward to running 6.0 Luna all day tomorrow to see how it compares.


TBH: I really like how fast 3.8 Flash is... Once I have clear plan, I feel quite confident in delegating large parts of implementation to Flash and Luna


Maddening for a bit - I've got problems that Flash is better on, and some Luna is better on, but I generally don't know until one has wasted time/tokens. Then I switch to the other one and... it's often just... bam - done. Correctly. I can't find the patterns ahead of time to determine what model I should be using first. :/ That said, I've been alternating between both the last month or so and they've both been pretty good compared to earlier models.


codex seems pretty solid on review, flash is fast on basics but makes more mistakes/errors, Claude is just to picky for me


look at token use, 3.8 flash is a huge token hog compared to openai models


I do like Typst, but Typst isn't really ideal for diagrams... you could use it that way but I don't think it's ideal. Mermaid or PlantUML are better/cleaner options.


Agreed. My resume and slides are all templated with Typst, but I can't be bothered trying UML languages to make diagrams that'll probably be referenced once or twice a year, if ever.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: