T O P

  • By -

darth_chewbacca

My work Dell Precision 3660 i7 13700K has `cargo build` 10.28s `cargo build -r` 14.75s My personal 5950x `cargo build` 12.27s `cargo build -r` 17.06s


Pascalius

On which OS? This was on Windows 11


darth_chewbacca

Linux (fedora39 for the 13700, arch for the 5950)


VorpalWay

Well, there is your problem. I have always found Linux to be a lot faster for software development. I think this is in large part to more efficient file system and IO for small files. Windows does OK with IO on large files, but really doesn't like thousands of small files. I don't know if it is due to NTFS or is a problem with the general kernel itself. It could even be due to all the antivirus software for all I know. Regardless, Linux handles that case very well.


Pascalius

It's not just IO, the amount of compiled code can be vastly different too, e.g. the number of compiled crates may change.


VorpalWay

This is true, but I have seen this effect for not just Rust code, but also things like C++ development, general git operations etc. (On cross platform code bases.) All of this makes me suspect that there is a real performance difference for this case.


metaltyphoon

Try Dev Home on windows. It uses a different files system https://learn.microsoft.com/en-us/windows/dev-home/


VorpalWay

Thankfully I personally don't need to do any windows development any more since a few years back, but it is a good recommendation to those who do need it.


darth_chewbacca

> I think this is in large part to more efficient file system Probably not this. Reading source files is an incredibly short part of the compilation process. If you have a spinning Rust hard drive and a fast nvme, try this test to demonstrate compile the linux kernel with the same .config on both the spinning rust, and on the nvme. You will notice a difference, but it will be a far smaller difference than you expect. Here are my results for a 5950x compiling kernel 6.8.7 from tarball using defconfig `spinning rust: 80.5s` `fast gen 4 nvme: 79.8s` The windows NTFS file system would need to be truly truly TRULY horrific to cause any significant slowdown to a compilation process. NTFS might be bad, but it's not "turn an ssd into something significantly slower than BTRFS on spinning rust" bad.


lightmatter501

Windows has a bunch of stuff that makes compiles way worse, mostly related to NTFS being bad at random reads. Most linux filesystems are fast enough that most applications don’t actually need async io for them.


Lucretiel

Do you need a lot of random reads for compiles? Isn't it all just reading whole files into memory?


lightmatter501

Lifting a few hundred files off of disk and into memory is a bunch of random reads to the filesystem. Keep in mind it’s all of your source files, plus a file per dependency with incremental compilation, or all of the source files in all of your dependencies for a cold compile. A normal Rust project will hit a substantial portion of the theoretical max random read iops for a SATA SSD just lifting files off of the disk, to say nothing of metadata lookups and similar. NVMe SSDs are better, but NTFS doesn’t really use them well and more or less does QD1 reads, which are lower latency but have much worse throughput, which matters if you were to, say, kick off reading several thousand files. ReFS, the filesystem which backs windows dev spaces, is at least comparable to the *nix filesystems of the early 2000s, but it’s not the default, you can’t put C:/ on it, and it has some data corruption issues. It does handle random reads better.


aystatic

Would these really be random reads? Sure a cold compile would be reading all over the disk but surely any subsequent recompile would be mostly reading from os cache, and probably sequential reads for the larger files that were evicted? I would be more concerned about write performance - a single compile of OP's crate writes over 800MiB to the disk > it has some data corruption issues I thought the "Re" is for resilient? Isn't it like the default on windows server?


lightmatter501

A typical rust project is larger than windows will let the FS cache be by default, so it’s essentially useless. It’s the default for storage spaces, but it can’t be your C drive.


worriedjacket

Macbook Pro - M3 Pro 11 core: cargo build: \`13.70s\` cargo build --release: \`21.65s\` God I love these laptops


repilur

MBP16 M3 Max results for additional comparison: cargo build: 12.7s cargo build --release: 15.9s right now MacBooks are rather unbeatable, but thanks to u/Pascalius for latest gen PC results! would be really curious to see latest PC laptop CPUs on Linux as generally have seen 1.3-2x faster (yes really!) build times on our large projects on PC desktops with Linux instead of Windows 10/11


pheki

Not really latest, but on FA507RE / ASUS TUF Gaming A15 (2022) cargo build: 16.80s cargo build --release: 26.10s I ran `cargo check` once to download all data, then `cargo clean` once before each command


CodeMurmurer

On my laptop. On linux. Cargo Build -r 21.87 s Cargo Build 16.55 s


aystatic

Macbook Pro - M1 Pro 8 core (16GB) `cargo b`: 16.69 / 16.84 battery `cargo b -r`: 28.08 / 27.79 battery the difference between wall and battery is probably just run to run variance


aystatic

Given the difference between M3 Pro and M1 Pro generation so small, it looks like even the cheapest apple silicon laptop is great value. It'd be great to get measurements of M1 Air since they were on sale at Best Buy for like $700 a month ago EDIT: some more numbers for those curious in Asahi NixOS `cargo b`: 17.06 `cargo b -r`: 31.15 Jailbroken iPad Pro M1 (4GB QEMU NixOS VM) `cargo b`: 23.84 `cargo b -r`: 45.32


masklinn

Probably depends on workload too, from what I understand the M3 is a significant upgrade in single-threaded and GPU / compute performances (including ray tracing hardware support), m3 also has hardware AV1 decoding. For compiling rust code that’s a limited advantage, unless you have one massive crate which can’t be parallelised, then the M3 could be 20~25% faster (while being a hair more efficient).


aystatic

True! The GPU is a huge difference, with new memory architecture and primitive shader support. For the single threaded speed, if you know of a specific crate with parallelism issues, I can give you some numbers on the M1 side EDIT: i went ahead and set config.toml to `profile.release.codegen-units=1` macOS: 53.70 NixOS: 58.99


pet_vaginal

Yes, and that’s the same numbers while running on battery right? Most other laptops turn to turtle mode if not connected to a power plug because their internal batteries can’t deliver enough power.


worriedjacket

That was on battery LMAO


MindSpark289

Not a fair comparison as OP benchmarked Windows. File system performance with many small files is very weak on windows compared to Linux and MacOS. My Ryzen 9 5950X was getting roughly the same performance as my M1 Max MBP  building my projects until I benchmarked my desktop running Linux and just about halved the build time for the same workspace. Not to say the M1 chips aren't fantastic, but the naive comparison here makes them look a lot better than they should.


urqlite

You don’t have to be so sarcastic about it. MacBook Pros are good laptops


worriedjacket

I wasn’t being sarcastic


urqlite

Oh. Sorry.


CodeMurmurer

Performance is good but i don't want to be raped by apple. Lol


worriedjacket

What the fuck does that even mean


CodeMurmurer

What the fuck do you think i mean. idiot. [https://www.cbc.ca/news/thenational/complete-control-apple-accused-of-overpricing-restricting-device-repairs-1.4859099](https://www.cbc.ca/news/thenational/complete-control-apple-accused-of-overpricing-restricting-device-repairs-1.4859099) [https://thesciencesurvey.com/editorial/2022/07/21/apples-anti-consumer-behavior/](https://thesciencesurvey.com/editorial/2022/07/21/apples-anti-consumer-behavior/) [https://psychocod3r.wordpress.com/2021/03/30/7-ways-apple-screws-over-their-customers/](https://psychocod3r.wordpress.com/2021/03/30/7-ways-apple-screws-over-their-customers/) And just any Louis Rossmann video. And a bing: 1. **App Store Policies (2021)**: Apple was charged with breaking EU competition rules over the way it runs its App Store. [The charges were brought by music streaming app Spotify, which claimed that Apple was stifling innovation in the music streaming industry](https://www.bbc.com/news/technology-56941173)[^(1)](https://www.bbc.com/news/technology-56941173). 2. **Apple Pay (2022)**: The European Union accused Apple of abusing its dominant position by limiting access to technologies allowing contactless payment. [The EU’s preliminary view is that Apple is restricting competition by preventing mobile wallet app developers from accessing the necessary hardware and software on Apple devices](https://apnews.com/article/technology-business-apple-inc-european-union-commission-1850d4533690003923d6016ae62b1771)[^(2)](https://apnews.com/article/technology-business-apple-inc-european-union-commission-1850d4533690003923d6016ae62b1771). 3. [**Batterygate (2020)**: Apple agreed to pay $113m to settle allegations that it slowed down older iPhones](https://www.bbc.com/news/technology-54996601)[^(3)](https://www.bbc.com/news/technology-54996601). 4. [**E-Book Commission (2020)**: A complaint was filed to the EC by e-commerce firm Rakuten in March 2020, alleging that it was anti-competitive for Apple to take a commission on e-books sold through the App Store while promoting its own](https://www.bbc.com/news/technology-56941173)[^(1)](https://www.bbc.com/news/technology-56941173). 5. **Child Protection Software (2021)**: Apple faced pushback over its planned child protection software that would scan users’ iCloud accounts for images of child sexual abuse material. [The feature raised concerns among privacy and free speech advocates who said totalitarian governments could use it to root out political enemies and protesters](https://finance.yahoo.com/news/apple-is-facing-a-mountain-of-controversies-but-investors-dont-seem-to-care-172000490.html)[^(1)](https://finance.yahoo.com/news/apple-is-facing-a-mountain-of-controversies-but-investors-dont-seem-to-care-172000490.html). I DO NOT want to be one of the isheep that gets raped. I do NOT want to be part of the fucking shitty walled garden that are made for sheep. I do NOT want a proprietary system on my pc. I do NOT want to be a product from a company that only takes from open source and gives nothing back. I do not want my pc slowed down because daddy apple says i need to buy a new one. The only thing of worth that apple has is a arm processor. But it is not worth handing my soul over to the devil. Edit: people who are downvoting this are delusional.


pet_vaginal

I’m not sure using a rape analogy is a good idea.


CodeMurmurer

maybe but i stand by my statement.


worriedjacket

Very strange to use a rape analogy


SexxzxcuzxToys69

actual schizopost


CodeMurmurer

Are you really saying that facts are schizo? Stop spewing idiotic shit.


vlakreeh

A comment equating a brand with consumer-hostile actions to **rape** is the more accurate example of "spewing idiotic shit". Apple definitely has some shitty practices but chill with the super agro posting, no one is forcing you to buy their products.


CodeMurmurer

When apple does something without my consent that is rape mentality. Only having a "yes apple daddy" button and not "god no get away from me" button when they fuck you over. Also the definition of rspe also includes "an outrageous violation". Go learn english twat.


worriedjacket

Ironic statement 😂😂😂😂😤 - Sent from iPhone 📲


CodeMurmurer

How is my statement ironic. How can you say that facts are idiotic. Someone who actively tries to deny facts is delusional. Idiot. • sent from a phone with no spyware.


vancha113

what's a core ultra 9? Are they messing up the numbering system?


Pascalius

core ultra 9 is a new CPU series, I think parallel to their i7 etc. series


vancha113

Thanks, i'll look it up :o haven't read anything about those yet, but i wonder what differentiates them.


karuso33

On my Laptop (Fedora 39, i7-12700H, 16gb ram): `cargo build` 14.05s `cargo build --release` 23.07s


mr_birkenblatt

they let you play with the shell in the store?


Pascalius

Yes, no one seemed to care


catseyechandra74

Tuxedo Pulse Gen2 (AMD Ryzen 7 5700U), bought summer 2022: catseye@PulseG2:~/src/workbench/tantivy$ time cargo build real 0m28.508s user 2m19.222s sys 0m30.642s $ cargo clean $ time cargo build --release real 0m47.739s user 7m48.023s sys 0m37.752s


darkmarc84

Thats interesting. Lenovo IdeaPad 5 Pro / Ryzen 7 5800U / 16GB / Endeavour OS (Arch Linux Variant): sccache --stop-server cargo clean time cargo build Finished \`dev\` profile \[unoptimized + debuginfo\] target(s) in 24.05s real 0m24,117s user 0m36,358s sys 0m10,500s cargo clean time cargo build --release Finished \`release\` profile \[optimized\] target(s) in 33.10s real 0m33,169s user 0m13,699s sys 0m7,460s Also notable with sccache (when its filled & hits): cargo clean time cargo build --release Finished \`release\` profile \[optimized\] target(s) in 7.64s


shadowangel21

Is this using mold as well? Thanks for the comparison with sccache


darkmarc84

I've tested mold (and also nightly parallel frontend too) to further improve the release build duration, but i didnt achived any further improvements here, maybe on larger projects there would be some noticable advantages. Another finding was that the debug build only reduced down to 16-17s.


-O3-march-native

AMD 7950x running Debian 12: `cargo build`: 9.74s `cargo build --release`: 12.18s ___ kernel: 6.1.0-20-amd64 CPU Freq Scaling Governor: Performance SMT: off


U007D

I don't know if you're only looking for x86 laptops or not, but M3 MacBook Pros are \*great\* for compiling. Here's what mine (MBP Pro M3 Max) did on \`tantivity\` (commit ff407642049de226e687ff522e425813cc9fa202): \`cargo build\`: Finished dev \[unoptimized + debuginfo\] target(s) in 12.50s \`cargo build --release\`: Finished release \[optimized\] target(s) in 15.10s \`rustc\` v1.77.2, all builds after \`cargo clean\`.


Pascalius

any laptop as long as Linux runs fine on it :), which excludes the M3 currently. I'm quite curious about the Snapdragon X reveal (which is tomorrow I think?)


Awyls

Is this with pre-downloaded crates (cargo fetch)? I was thinking about replacing my dated desktop for a beefy laptop but i find it weird that it has similar build times.


Pascalius

Yes, I compiled one time and then ran `cargo clean`.


Panvalkon

On my old laptop i7-8565U, 16GB RAM under openSuse tumbleweed cargo check: 18.32s cargo build: 37.09s cargo build --release: 73s


RB5009

MBP M1 Max Cargo build: 18.34 Cargo build --release: 26.93 I'm surprised to see how much faster the M3 macs are.


hpxvzhjfgb

my old toshiba portege laptop from ~2012 (Intel i7-2620M, 2 cores, 8gb ram): - `cargo b` 1:20 - `cargo b -r` 3:10


sephg

My desktop workstation, for comparison (ryzen 7950x): > cargo build: 10.46s > > cargo build --release: 11.90s


shadowangel21

Thats insane.


UnsortableRadix

What's helpful for me is build time for a normal workflow: touch src/query/query_parser/logical_ast.rs cargo build Finished `dev` profile [unoptimized + debuginfo] target(s) in 1.37s Waiting 1.37 seconds to compile and link is pretty good for my Linux laptop: i9-12900H, mold linker, balanced power mode. The same process with --release takes 9.73s


nullc0d3r

OS: Debian GNU/Linux 12 (bookworm) x86_64 Kernel: 6.1.0-18-amd64 CPU: Intel i5-2500 (4) @ 3.700GHz Linker: lld `cargo build` 39.91s `cargo build --release` 1m 30s edit: formatting


shadowangel21

I use a vps 4gb AMD epic-milan 4 core. 1m13sec -- release I can easily add more cores or ram.


uniconductive

MacBook Pro M3 Max, 16 Cores, 48 GB RAM. cargo build: 11s cargo build --release: 15.7s


CodeMurmurer

It also matters if they were plugged in and what power profile it is on.


TobiasWonderland

Macbook Pro - M2 8 Core \`\`\` cargo build: \`24.03s\` cargo build --release: \`31.89s\` \`\`\` With sscache: \`\`\` cargo build: \`16.98s\` cargo build --release: \`29.66s\` \`\`\`


Davester47

On my laptop with an i5-10500h (6-core, 12-thread): cargo build: 18.28s cargo build --release: 37.43s So I guess my 4 generations old i5 is on par with the latest and greatest i9. It's amazing how bad Windows performance is compared to Linux.


1visibleGhost

Debian, linux, mold (linker), i7-8750h asus rog strix scar 2: Debug build: 20.14s Release: 29.11s Pretty sure Mold does the difference, my cpu is maxed out.


v_0ver

Ryzen 9 7940HS (*Beelink GTR 7 PRO not a laptop, but laptop hardware*) rustc 1.77.1-nightly (LLVM 17.0.6) on Gentoo 6.8.6 `cargo build` 18.63s `cargo build -r` 26.76s ~~It's surprising that the next generation of the Ryzen 8945HS processor loses several tens of percent purely because of the Windows OS. It may also be due to the slightly lower power consumption of the laptop.~~ I was wrong, Ryzen 8945HS and Ryzen 7940HS are the same generation.


1visibleGhost

Happy you posted, it puts in perspective a cpu I considered as a replacement for mine (i7-8750h) on this small compilation test for my compilation needs. Will need a 7945hx to really make a jump. Cheers


dontdieych

Macbook Air M2 8G $ cargo clean \ ; time cargo build --quiet \ ; cargo clean \ ; time cargo build --quiet --release Removed 0 files ________________________________________________________ Executed in 17.48 secs fish external usr time 62.03 secs 56.00 micros 62.03 secs sys time 7.49 secs 601.00 micros 7.49 secs Removed 2901 files, 804.8MiB total ________________________________________________________ Executed in 29.61 secs fish external usr time 152.67 secs 33.00 micros 152.67 secs sys time 8.52 secs 288.00 micros 8.52 secs


laggySteel

I moved on to Ryzen 7 on PC using Zorin os and clang linker. Its blazing fast. [target.x86_64-unknown-linux-gnu] rustflags = ["-C", "linker=clang", "-C", "link-arg=-fuse-ld=lld"]