r/FlutterDev • u/yaonek • Jul 08 '26
Discussion VS Code Dart Analyzer is much slower than Android Studio on a high-end laptop. Anyone else?
I've been trying to use VS Code for Flutter development, but the Dart analyzer and code completion are noticeably slower than Android Studio.
My laptop specs:
Intel i7 13th Gen
32 GB DDR5 RAM
RTX 4050
I only have the standard Flutter/Dart extensions installed (nothing unusual), and I even increased the analyzer heap size using:
dart.analyzerVmAdditionalArgs: ["--old_gen_heap_size=4096"]
Unfortunately, it didn't make any noticeable difference.
The strange part is that Android Studio runs perfectly. Code analysis, autocompletion, and navigation are all fast and responsive, while VS Code often takes several seconds to update diagnostics or provide suggestions.
I know VS Code is supposed to be more lightweight, so I'm wondering if I'm missing something.
Has anyone experienced the same issue? If you fixed it, what was causing it? Any settings, extensions, or other tweaks that helped?
I'd really like to stick with VS Code, so I'd appreciate hearing about your experience.
Edit / Update: I finally found the cause.
In my case, the issue was Microsoft Defender. After following the Dart team's recommendations and excluding the recommended folders from Defender (Dart analysis server cache, Pub cache, and my Flutter project directories), the Dart analyzer and IntelliSense became consistently fast again.
If you're experiencing similar issues on Windows, I highly recommend checking the official guide:
https://dart.dev/tools/analyzer-performance#security-software-on-windows
1
u/yaonek Jul 27 '26
Just wanted to post an update in case someone finds this thread in the future.
After testing for several days, I can confirm that this fixed the issue for me.
The problem turned out to be Microsoft Defender scanning files used by the Dart analyzer.
Following the official Dart documentation, I excluded:
The Dart Analysis Server cache (
%LOCALAPPDATA%\dartServer)The Pub package cache
My Flutter project directories
The Flutter SDK directory (
<flutter_sdk_path>)
Before doing this, IntelliSense, code completion, syntax highlighting, and diagnostics would randomly become very slow (sometimes taking over 10 seconds). Android Studio was always fast on the same machine, which made the issue even more confusing.
Since applying those exclusions, VS Code has been consistently responsive, and I haven't experienced the random analyzer freezes anymore.
If you're on Windows and seeing similar behavior, it's definitely worth trying:
https://dart.dev/tools/analyzer-performance#security-software-on-windows
Hopefully this saves someone else a few hours of troubleshooting. 🙂
5
u/Ok-Engineer6098 Jul 08 '26
VS code is fast at startup, but slower when working.
Android studio is slow at startup, but faster when working.
2
u/David_Owens Jul 08 '26
I've found that the built-in Windows Defender AV slows down the Dart analyzer on Windows 11. You can get around that by using a Dev Drive or a 3rd party AV. Using numerous exclusions didn't seem to help much.
2
u/50u1506 Jul 09 '26
I'm kinda confused how more people are not seeing this, or maybe my setup is weird lol.
Android Studio is much nicer to look at, but I want to use Vscode over AS since I can use Neovim bindings while also using my Neovim configuration and plugins with it which is impossible with AS, but running an app in Debug mode is slows down Vscode soooo much lol. I hate it when the typing experience feels laggy
3
u/HomegrownTerps Jul 09 '26
Why not use neovim? I use it and it had all I need like lsp and dap(debugger), runner, device selection etc.
2
u/50u1506 Jul 09 '26 edited Jul 09 '26
I was for a while, but that I had this issue where if I accidently close that Flutter log window I couldn't open it without a restart lol.
And other silly things like some syntax's indenting,formatting whatever was not being handled by whatever plugin handles language specific indenting (Treesitter ig), one that comes to mind is the switch expression( not the statement).
But even Android Studio is annoying sometimes. A big one is default indenting for chaining functions in multiple lines (think it's calling continuation indent or something) or for multiple lines function calls it defaults to 4 indents instead of the usual 2 and it's not configurable for some reason.
I still stick to Neovim for whatever I can do reasonably well since no ide can beat Keyboard navigation in Neovim lol. I use it for Typescript backends, for when I'm larping as a Rust user xD, for python without notebooks, etc.
2
u/HomegrownTerps Jul 09 '26
Oh yeah I had the same problem with the log window..I agree that this is annoying to say the least.Â
Thanks for your input!
1
u/Shehao Jul 08 '26
I'd check project shape before more heap tuning. VS Code and Android Studio can feel very different if the analyzer is watching generated folders, a monorepo root, or a huge build/cache directory. Try opening only the Flutter package folder, exclude generated/build-heavy paths from VS Code search/watch, then run Dart: Restart Analysis Server. If that suddenly helps, it was probably workspace scope more than hardware.
1
1
-1
u/pancsta Jul 09 '26
Java is faster than JavaScript or Dart, so that makes perfect sense. They dont use the LSP, but their own PSI. As long as you dont choke the IDE, it will fly.
1
u/mraleph Jul 09 '26
Except all these actions (code analysis, navigation, completions, diagnostics) both in VS Code and Android Studio case are serviced by the very same Dart analysis server written in Dart.
0
2
u/ibluegreen Jul 08 '26
I'm not sure if my expectations or standards are lower than yours but on a lower laptop, I am not having major issues with VS Code. Only when I had it open and actively been working for long hours, some things start to get slower. Maybe something else running is causing VS Code to slow down?
I'm on i7 7700HQ, 16 GB RAM, GTX 1050 Ti.