5 ms·
Note how the OP uses an M1 laptop w/64MB of ram. If you want to compile a monolithic web application written in Rust within a reasonable amount of time, you ne
by Dowwie 4y ago
Note how the OP uses an M1 laptop w/64MB of ram. If you want to compile a monolithic web application written in Rust within a reasonable amount of time, you need that much top-of-the-line hardware for your work. You're still waiting several minutes to compile, but compile times get even worse with older hardware running debian and mold/lld. CI test/build runs also take a long time to complete.
Edits: 64GB, not 64MB. 32GB is really the minimum recommended
- zozbot234 4y ago> w/64MB of RAM. So, an Apple Newton in a laptop form factor?
- Dowwie 4y agoOh, I did just say MB. It's early here.
- brabel 4y agoNo one has corrected this yet, so I'll do it: it's 64GB of RAM! The Mac M1 Max the author used is an absolute beast of a machine. I have a M1 Pro (which is not as fast) and it's ridiculously faster (and quieter - it barely needs a fan) than my Linux Dell XPS13 and older Macbook Pro.
- strager 4y agoIt is a beast. I love my MacBook Pro!
- josephg 4y agoI don’t think 64mb of ram is necessary at all. And minutes? What are you compiling? How big is your codebase? Are you doing everything in docker or something? Rustc is slow but I’ve never seen it be that bad. I’ve been working on a rust project for a couple of years, currently sitting at about 40k loc. Incremental debug builds still only take a second or two. Full compiles take about 10 seconds.
- Dowwie 4y ago32GB ram is a minimum, not 64. No docker for local dev. If you find this unrelatable, you're not working on a monolith web application using dozens of dependencies and utilizing macros to the extent that one would be if they were using sqlx and other libs.
- bogeholm 4y agoI’ve used a first-gen M1 MacBook Pro with 16GB of RAM, and that was pretty good for Rust development. No hard numbers, just anecdata. Edit: now I think about it, the first time I heard the fan on the machine (out of ~3 times in ~2 years) was when I built a Rust project while running Airflow in docker compose under Rosetta emulation, back when one of the Docket images didn’t support arm64
- Narishma 4y ago> I don’t think 64mb of ram is necessary at all. Indeed, 640KB should be more than enough.
- strager 4y ago> Note how the OP uses an M1 laptop w/64MB of ram. I tested with two different machines: * Linux machine with an AMD Ryzen 9 5950X * macOS machine with an M1 Max Each chart is labelled with 'Linux' or 'macOS'. > If you want to compile a monolithic web application written in Rust within a reasonable amount of time, you need that much top-of-the-line hardware for your work. You're still waiting several minutes to compile, but compile times get even worse with older hardware running debian and mold/lld. CI test/build runs also take a long time to complete. This is true with C++ as well. The article focused on the build-test development cycle, but you're right that the compile time issue would be worse on older hardware and CI.
- FpUser 4y agoI write web applications in C++. I definitely do not wait "several minutes" to compile. If it is a change in single CPP file it compiles under a second on my AMD 3950X desktop. Full rebuild takes 16 seconds (it includes compiling some libs I use).
- Gigachad 4y agoI've made some production services in Rust. I use a 16GB M1 and the thing compiles in under a minute. Incremental compilations are almost instant. The crates you import seem to add the vast majority of compile time stuff like an ORM brings in a lot of code but I still don't see this being an issue. It's so much faster than working on the React app and even that seems fine. Unless you are working on some absolute mega project like chromium, compile time seems like a minor detail.
- nicoburns 4y ago> Unless you are working on some absolute mega project like chromium, compile time seems like a minor detail. IF you have an M1 then sure. But bear in mind that’s 10x faster than the machines that some people are still using.
- Dowwie 4y agoI posted the parent comment. The required investment in new hardware for reasonable Rust developer experience cannot be understated. I took the poor hardware approach to software design with Rust and it came at the benefit of shorter compile times. Then, I worked with Rust monoliths that went all-in on macro-heavy libraries and felt the pain on my older workstation. It's interesting to think about the different decisions that one makes with the resources available, and constraints.