Last week, Takari announced that Google is Maven Central's New Best Friend. While writing a news article about this for InfoQ, I decided to run a small test to see the speed of the default Maven Central versus the new Google Cloud Storage instance. This micro benchmark didn't seem worthy of including in the article, but I think it's interesting to see the speed improvements I found.
rm -rf ~/.m2/repository, then
mvn install with the default repository configured. I ran the commands again with
Google Cloud Storage. I found that the downloading of dependencies, compilation and running unit tests on
AppFuse's web projects averaged 4 minutes, 30 seconds.
With Google Cloud Storage, the same process averaged 3 minutes and 37 seconds. By my calculations, this means you speed up artifact resolution
for your Maven projects by 25% by switching to Google. To do that, create a
~/.m2/settings.xml file with
the following contents.
<settings> <mirrors> <mirror> <id>google-maven-central</id> <name>Google Maven Central</name> <url>https://maven-central.storage.googleapis.com</url> <mirrorOf>central</mirrorOf> </mirror> </mirrors> </settings>
My tests were run on a Mac Pro (late 2013) with a 3.5 GHz 6-Core Intel Xeon E5 processor and 32 GB of RAM. Bandwidth speeds during this test averaged 57 Mbps down, 6 Mbps up. Below are the timing numbers (in minutes) from my test:
Default: 4:33, 4:36, 4:32, 4:24, 4:09 Google: 5:13, 3:35, 2:15, 3:38, 3:39
Google had some wide variances in its results, with five minutes and two minutes. Because of this, I dropped the low and high numbers for each service before calculating the average. My math with raw numbers is below.
Default: 273, 276, 272, 264, 213 = 260, 4:20 276, 272, 264 = 270, 4:30 Google: 313, 215, 135, 218, 219 = 220, 3.66 = 3:40 215, 218, 219 = 3:37
Chen Eric commented on the InfoQ article to note that Chinese programmers are blocked from using Google.
Update: Jason Swank of Sonatype has done some more extensive benchmarking and found different results.
We found that average unprimed Google API (first mvn run) caching performed 30% slower than Maven Central. Primed Google API cache performance (second run) was 3% faster then Maven Central (second run). We also ran a number of cloud-based tests with similar results.