[JAVA] Ubuntu on Windows build speed

Introduction

I was developing a large project such as Java and node.js, and I was told which is better as a development environment, Windows or Linux. Among them, I suggested that you can use the best of both worlds by using Ubuntu on Windows, but there was talk that Ubuntu on Windows hesitates to use it because disk access is slow and build is slow. So I actually measured it. Virtual Box (hereinafter V Box) is also available for comparison.

Evaluation environment

--The build target is the Elasticsearch source (5/18 version) from github. It doesn't make any sense to be Elasticsearch, as it would have been nice to have a longer build. ――Since it is built by Java, I think that doing both Windows and Linux will not change that much. Java uses Oracle Java 10. --The build environment is host CPU 16 Core, memory 16GB, SSD. VBox is built on the same machine as the host with 8Core CPU and 8GB memory. --The build command is gradlew clean assemble. Execute this 3 times for each condition and see the execution time. The first gradlew will download various things such as maven, so ignore the first result. --Try 3 patterns of build directly from Windows, build on Ubuntu on Windows, and build on Ubuntu 18 of VBox for the same source code

Evaluation result 1

Windows Ubuntu on Windows Ubuntu on VBox
13:08 14:14 5:36
12:55 12:56 5:41
13:11 12:45 5:36

The unit is minutes: seconds

Consideration

After trying so far, I found that Windows / Ubuntu on Windows was strangely slow, but I felt a little strange about this result. In the first place, VBox has the advantage that it is a clean environment prepared just for this purpose.

Since small files are created, deleted, and modified in the build, I decided to remove the real-time file protection of Windows Defender by going to see these files one by one. It's a good idea to make only the build folder a scan exception, as you can't afford to lose too much security.

How to exclude real-time scans

Evaluation result 2

We found that stopping the real-time scanning of the build folder made a big improvement. VBox unscanned the folder that stores VBox's disk, but didn't see any improvement, probably because it didn't flush the I / O very finely.

Windows Ubuntu on Windows Ubuntu on VBox
8:24 8:35 5:37
8:13 8:14 5:37
8:28 8:21 5:38

The unit is minutes: seconds

Summary

――The speed of building directly on Windows and Ubuntu on Windows did not change so much. --The presence or absence of real-time scanning greatly affects the build time. Measures such as registering a folder for git as a scan exception are effective. --Building in VBox is not inferior to building in the host. This time it was a VM created just for this purpose, so it didn't contain any extra tools and was rather faster than the host. ――We expect that it will approach the same level by setting up the development environment on VBox in earnest.

Recommended Posts

Ubuntu on Windows build speed
Build ffmpeg 4.3.1 on Ubuntu for Windows
Build Zabbix on Ubuntu 20.04
Build VNC Server on Ubuntu 20.04
Ubuntu on Windows Community Preview
Manually build OpenJDK on Windows
Build the latest Samba 4 on Ubuntu 20.04
Build a XAMPP environment on Ubuntu
How to build vim on Ubuntu 20.04
Build OpenCV with Java Wrapper on Ubuntu 18.04
tmux on Ubuntu
Build and install Wireshark Development Release (3.3.1) on Ubuntu
[Java] Build Java development environment on Ubuntu & check execution
Build a DHCP and NAT router on Ubuntu 16.04
How to build a Pytorch environment on Ubuntu
Screen recording on Ubuntu 20.04
Web Bluetooth on Ubuntu20.04
Try DisplayLink on Ubuntu 20.04
Reinstall Kubernetes on Ubuntu 19.10
Use Flutter on Ubuntu
Install pyqt5 on ubuntu
Setting JAVA_HOME on Ubuntu
Install Autoware on Ubuntu 18.04.5
Put JetBrains on Ubuntu
Use mkdir on ubuntu
Apache2 on Ubuntu20.04 LTS
Use cpplapack on ubuntu
ubuntu on wsl part 10
Install Homebrew on Ubuntu 20.04
Run tiscamera on Ubuntu 18.04
M.S. docker on Windows
Build Ubuntu 20.04 LTS desktop environment on Raspberry Pi 4 (+ Japanese)
I built an Ubuntu environment on Windows 10 using WSL2.
Easily build Redmine on Windows using WSL2 and Docker
Talk about introducing Ubuntu 20.04 on Windows 10 and text editor
Install Ubuntu 20.04 in virtual box on windows10 and build a development environment using docker
Create SSL certificate on Ubuntu 18.04
Install Docker on Windows 10 PRO
Put Ubuntu 20.04.1 on Raspberry Pi 4
Install Docker on Ubuntu Server 20.04
Japanese input on Ubuntu20.04 Desktop
Run openvpn on Docker (windows)
Try Docker on Windows 10 Home
Oracle Java 8 on Docker Ubuntu
Install zabbix agent (5.0) on Ubuntu 18.04
Install Arudino IDE on Ubuntu 20
Record video on ubuntu18.04 LTS
Introduced knowledge (wiki) on Ubuntu
Installing OpenMX on Ubuntu 18.04.5 LTS
Ruby installation on WSL2 + Ubuntu 20.04
Install Ubuntu Desktop 20.10 on RaspberryPi4
Run chromium-mir-kiosk on Ubuntu Core
Run java applet on ubuntu
Wifi adapter not recognized on Ubuntu with Windows dual boot
Install raspi-config on Ubuntu 20.04 (LTS)
Build mate desktop environment on ec2 with terraform (Ubuntu 20.04LTS)
Install WordPress 5.5 on Ubuntu 20.04 LTS
Build Ubuntu 18.04.5 with dual boot
Run Eclipse CDT on Ubuntu
Set up ansible-playbook on Ubuntu 20.04
Install PlantUML on Intellij on Ubuntu