Same SSD, the same project, the same version of Android Studio. Dual boot W10 and Ubuntu 17.10. On Ubuntu, Android Studio launches, loads the project and finishes sync and gradle compilation in 12-14 seconds, on Windows 10 it takes 53 seconds.
Fresh install multiple times on both systems. Also, on a late 2015 iMac with system configuration almost identical to my pc, the times are almost identical to those on Linux.
YOUTUBE: Windows vs. Linux (Android Studio): https://youtube.com/watch?v=K4HR2pVQdDo
LE: After I disable windows defender for all folders with Android Studio, Android SDK and project folder and deactivate the Windows Search service, I reduced to 38 seconds.
I still have a huge difference over the 12-14 seconds on Linux and MacOS. Fresh install of W10 with up-to-date updates.
On Windows after the project is loaded, Android Studio does some gradle and sync compilations for more than 20 seconds. On Linux and macOS it takes up to 4 seconds.
What is the explanation and how can Android Studio upload the project in Windows as fast as it does it on Ubuntu and MacOS?
This happens every time I start Android Studio and open the project (later compilations are also fast on Windows, although Linux and MacOS are faster).
Why is so slow on Windows?
Is there any conclusion / resolution? Or is Windows really an Android & Java development avoided OS?
Those steps that run only on Windows I do not manage to see on Linux and macOS - or they run instantly or they don't run at all, but it is certain that those things take over 20 seconds on Windows:
IMAGE: Windows gradle compilation and sync, takes over 20 seconds
Linux performs better for Android Studio than Windows. Android Studio needs at least 8 GB RAM to run better. Change your Hard Disk to SSD.
There is nothing in Linux regarding android development which is not possible in Windows. Though if you have never used Linux environment then stick with Windows to keep things simple.
To install Android Studio on your Mac, proceed as follows: Launch the Android Studio DMG file. Drag and drop Android Studio into the Applications folder, then launch Android Studio. Select whether you want to import previous Android Studio settings, then click OK.
The System Requirements for Android Studio on Windows Your PC must meet the following requirements to run Android Studio efficiently: 64-bit Microsoft Windows OS 8/10/11. 1280 x 800 minimum screen resolution.
Try disabling anti-virus protection for your Gradle caches directory, Android Studio project directory, and additional Android directories listed below. For me, this made a huge difference. From what I've read, a big chunk of time is spent doing anti-virus scanning on intermediate files and JARs, and this dramatically slows Java compilation. Excluding those same directories from Windows search indexing can also help.
As of September, 2020, this is the list of default directory locations that should be exluded from virus scanning and Windows search indexing, published here.
%USERPROFILE%\.gradle
%USERPROFILE%\AndroidStudioProjects
%USERPROFILE%\AppData\Local\Android\SDK
%USERPROFILE%\.AndroidStudio<version>\system
I published some instructions on my blog for doing this for Windows Defender and Windows Search Indexing, which I'll repost here for completeness:
Windows Defender - How to Exclude a Directory
Windows Search Indexing - How to Exclude A Directory
So damn true! I experienced the same thing. Build time go down to hell on Windows and go up to heaven on Ubuntu/Linux distros, even on very very strong CPU power computer. I guess JVM is just simply can't perform well on Windows OS.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With