Hello Rustaceans! I'm a new Rustacean setting up dev environment with VSCode and
rust-analyzer. I observed that
rust-analyzer is running about 5 times faster on Linux than on Win10 (I use the same settings as using
clippy). Is this behavior expected? Here is my environment:
Win10 (local OS on laptop):
- toolchain: stable-x86_64-pc-windows-gnu
Ubuntu 20.04 (guest OS in VMware on Win10):
- toolchain: stable-x86_64-unknown-linux-gnu
update: the laptop is ThinkPad P1, using SSD
update: I highly suspect Windows Defender causes this issue. Every time I save my
.rs file (this triggers
antimalware service will be triggered, and its CPU usage is high. I tried to set the whitelist as follows, but it doesn't work. Any suggestions?
Thanks for replying! No, I'm using SSD. I will update the hardware details.
If it is Microsoft Defender, could you try whitelisting the
target folder of your project? I believe that's where rust-analyzer will be storing all the intermediate files it writes to while compiling/checking code.
Thanks! I updated my whitelist to include my workspace folder as follows. Yes,
rust-analyzer now runs faster (now it runs about 2 times faster on Linux than on Win10)
But still, Windows Defender will be triggered when I save my rust file, which might explain the speed difference between Linux and Win10. So, some more folders should be included in the whitelist. Unfortunately I have no idea now
This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.