Best CPU for compile in Windows

I'm considering upgrading my PC because compiling a cross-platform desktop app on Windows has been frustratingly slow—over 10 minutes for a fresh build and 10 seconds for an incremental recompile using the Tauri framework.

If you have a powerful CPU and are running Windows (not Linux or macOS), I’d greatly appreciate your help testing compile times! Here’s how you can check:

  1. Open PowerShell.
  2. Run the following commands
cargo install create-tauri-app --locked
cargo create-tauri-app  # Press Enter to accept the defaults.
cd tauri-app/src-tauri
cargo fetch
Measure-Command { cargo build }
  1. To check recompile time, make a small edit to lib.rs and run Measure-Command { cargo build } again (twice).

Please share your results with me, including:

  • Fresh build time (in seconds).
  • Recompile time (in seconds).
  • Your CPU model.

For reference, here are my results:

  • CPU: AMD Ryzen 5 4500U
  • Fresh build: 6 minutes 26 seconds (410 crates).
  • Recompile: 10 seconds (after editing lib.rs).

I’m curious to see how other CPUs perform on Windows!
Thanks : - )

  • CPU: AMD Ryzen 9 5900X
  • Fresh Build: 1 minute, 3 seconds.
  • Recompile: 2.8 seconds.
1 Like

cargo-clif+nightly:

  • CPU: AMD Ryzen 5 4500U
  • Fresh Build: 2 minute, 49 seconds.
  • Recompile: 6.39 seconds.

Cranelift:

  • Fresh Build: 50.7 seconds.
  • Recompile: 1.8 seconds.
2 Likes

CPU: Intel i7-1260p (my work Dell XPS 13+ laptop)

Balanced power mode, first run:
Fresh build: 1 minute, 31 seconds
Recompile: 8.2 seconds

Balanced power mode, later runs (after cargo clean):
Fresh build: 1 minute, 40 seconds
Fresh build: 1 minute, 50 seconds
clearly getting thermally throttled :stuck_out_tongue:

Best performance power mode, (with some cool down time):
Fresh build: 1 minute, 18 seconds
Recompile: 8.0 seconds
Fresh build: 1 minute, 15 seconds

When I get home, I'll update with my home PC with a 7800X3D.


As promised (though note this is without dev drive):

CPU: AMD 7800X3D
Fresh build: 57.3 seconds
Recompile: 6.3 seconds


Interestingly, adding a Windows Defender exclusion to the project directory doesn't help the first time after adding the exclusion, but runs after that consistently hit

Fresh build: 49 seconds
Recompile: 1.7 seconds

And even without the exclusion the second recompile (still with edits!) hits 2s ... some sort of disk cache effect, I assume?

1 Like
  • CPU: AMD Ryzen 9 9950X
  • Fresh Build: 39 seconds.
  • Recompile: 1 seconds.
3 Likes

i5-12400 - win 10 & 32 GB RAM @ 2400 MHz

Clean build - TotalSeconds : 60,1872843
Diff build - TotalSeconds : 2,3734128

1 Like

CPU (just now realizing you want benchmarks for CPUs to upgrade to and my CPU is not good, but I already ran the measurements so I’ll post them) Intel Pentium G4560
Windows 10, 16 GB RAM, and an old HDD
Fresh Build 7 minutes 6 seconds
Recompile 8.1 seconds

2 Likes

Cleaned thermal paste and cleaned the fans
cargo-clif+nightly:

  • CPU: AMD Ryzen 5 4500U
  • Fresh Build: 1 minute, 18 seconds.
  • Recompile: 7.2 seconds.

Also tested on Linux out of curiosity

  • CPU: AMD Ryzen 5 4500U
  • Fresh build: 1 minute 5 seconds
  • Recompile: 2.6 seconds (after editing lib.rs).

Ubuntu 22.04 with mold linker and cranelift backend.

I know you're asking for desktops, but I thought I'd chime in with my laptop too. It's a Framework Laptop 13 and it's been warmed up. These results are with the charger plugged in and on the extreme preset in GitHub - JamesCJ60/Universal-x86-Tuning-Utility: Unlock the full potential of your Intel/AMD based device..

  • CPU: AMD Ryzen 7 7840u
  • RAM: DDR5 5600MHz
  • Fresh Build: 1 minute, 22 seconds
  • Recompile: 3 seconds

For science, I performed the same test on Linux (Fedora 41):

  • Fresh Build: 53 seconds
  • Recompile: <1 second (~700ms)
  • Linker: mold

Disclaimer: the dependencies are quite different for Linux compared to Windows.

1 Like

With the rust-lld linker:

  • CPU: AMD Ryzen 7 3700X
  • Fresh build: 1 minute 18 seconds
  • Recompile: 8 seconds (after editing main.rs).
1 Like

Good thread! I was just googling for this and it's nice to find some data points.

  • CPU: Intel i5-10600K
  • Fresh build: 1 minute 26 seconds
  • Recompile: 10 seconds (after editing main.rs).

I'm also using an NVME drive.

1 Like
  • CPU: AMD Ryzen 3960X

nightly:

  • Fresh build: 1 minute 8 seconds
  • Recompile: 10 seconds (after editing main.rs).

nightly, LLD, -Zthreads=8, lto="off", debug="line-tables-only":

  • Fresh build: 43 seconds
  • Recompile: 2 seconds (after editing main.rs).

nightly, LLD, -Zthreads=8, codegen-backend="cranelift":

  • Fresh build: 39 seconds
  • Recompile: 6 seconds (first edit of main).
  • Recompile: 2 seconds (second edit of main).
    (no idea why the first rebuild takes longer)

Additional factors:

  • defender off
  • it's a virtual machine
  • ReFS volume (I would have tried dev drive, but that's not available in this VM image)
  • disk write flushing disabled
1 Like

Very fast! just to make sure, can you try the recompile part but while editing lib.rs instead?

lib.rs edit, rebuild:

  • cranelift: 6s
  • llvm: 7s

Thanks! Now I can clearly see that much better cp u won't make recompile (and relink) faster. We need faster linker for Windows

There does seem to be something like a caching effect, given the split between the recompile times and the effects I was seeing. Very odd!

1 Like

Ryzen 7900x, DDR5 6000Mhz, All files on nvme disk

Fresh build : 48 seconds
Recompile : 8 seconds

1 Like
  • CPU: 13th Gen Intel(R) Core(TM) i9-13900HX
  • Fresh build: 1 minutes 5.90 seconds (410 crates).
  • Recompile: 20.34 seconds (after editing src-tauri/src/lib.rs).

When compiling the 408th and 409th, it is extremely slow
It doesn't look quite normal

1 Like
  • Fresh build time: 62.4875795 sec
  • Recompile time: 9.6628965 sec
  • CPU model: i7-12700, with 4 E-cores disabled.

Edit: I re-enabled all the E-cores, now the result is:

  • Fresh build time: 54.2832471 sec
  • Recompile time: 7.5378553 sec
1 Like