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.
--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
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
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.
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
――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