Skip to content

Commit 69b93cf

Browse files
committed
Mention DevDrive and Antivirus settings on Windows
1 parent 3639104 commit 69b93cf

3 files changed

Lines changed: 22 additions & 0 deletions

File tree

47.2 KB
Loading

content/blog/tips-for-faster-rust-compile-times/index.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ Click here to expand the table of contents.
4848
- [Switch To A Faster Linker](#switch-to-a-faster-linker)
4949
- [macOS Only: Faster Incremental Debug Builds](#macos-only-faster-incremental-debug-builds)
5050
- [macOS Only: Exclude Rust Compilations From Gatekeeper](#macos-only-exclude-rust-compilations-from-gatekeeper)
51+
- [Windows Only: Set Up Dev Drive For Rust](#windows-only-set-up-dev-drive-for-rust)
5152
- [Tweak Codegen Options And Compiler Flags](#tweak-codegen-options-and-compiler-flags)
5253
- [Avoid Procedural Macro Crates](#avoid-procedural-macro-crates)
5354
- [Conditional Compilation for Procedural Macros](#conditional-compilation-for-procedural-macros)
@@ -442,6 +443,27 @@ The solution is to add your terminal to the Developer Tools, which will cause pr
442443

443444
Thanks to the [nextest](https://nexte.st/docs/installation/macos/) and [Zed](https://zed.dev/docs/development/macos#tips--tricks) developers for the tip.
444445

446+
### Windows Only: Set Up Dev Drive For Rust
447+
448+
Windows 11 includes [Dev Drive](https://learn.microsoft.com/en-us/windows/dev-drive/), a file system optimized for development.
449+
According to Microsoft, [you can expect a speed boost of around 20-30%](https://devblogs.microsoft.com/visualstudio/devdrive/) by using Dev Drive:
450+
451+
![Dev Drive Performance Chart](DevDrivePerfChart.png)
452+
453+
To improve Rust compilation speed, move these to a Dev Drive:
454+
455+
- Rust toolchain folder (`CARGO_HOME`)
456+
- Your project code
457+
- Cargo's `target` directory
458+
459+
You can go one step further and **add the above folders to your antivirus exclusions as well**
460+
for another potential speedup.
461+
You can find exclusion settings in Windows Security under Virus & threat protection settings.
462+
463+
![Antivirus Exclusion Settings on Windows](windows-antivirus-exclusions.png)
464+
465+
Thanks to the [nextest team](https://nexte.st/docs/installation/windows/) for the tip.
466+
445467
### Tweak Codegen Options And Compiler Flags
446468

447469
Rust comes with a huge set of [settings for code
26.4 KB
Loading

0 commit comments

Comments
 (0)