Performance – Maven builds 3 times in OSX

I recently had a new Macbook Pro working and noticed that it takes about 15 minutes to build our code base in Maven2, while others in my team use slightly older The Macbook (but similar/same specifications) builds in about 5 minutes. After asking around, I found another person in the team and his build takes 15 minutes. I’m talking about a new code review, all of us Both use the same version of Maven (2.2.1) and Java version: 1.6.0_29, run’mvn clean install’ from the root directory of the project. Both of our slow builds are on Lion (10.7.3), and 5 minutes The person who built it is on Lion or Snow Leopard. My machine has 8GB RAM and 2.3 GHz i7, so it doesn’t seem to be an issue. AFAIK, this machine is equipped with Lion (not upgraded from Snow Leopard), so I think It is not upgraded from Snow Leopard, it seems that some people have problems. Our slow builds all have 5400 rpm drives, while most of the others have 7200 rpm drives, but one of them has a 5 minute build and the others Have exactly the same 5400 rpm drive as ours…so such a rule out of that theory.

I ran a memory test (checked out normally), ran disk verification and permission repair in Disk Utility (Fixed some permissions issues, but did not change the build time), disable swap, make sure filevault is closed, build directories from different, nothing helps. Some interesting points make me suspect operating system issues:

>Me An Ubuntu virtual machine is installed on this machine, and the’mvn clean install’ there is even faster than the native machine in OSX (10 minutes vs. 15 minutes)! FYI, the local Ubuntu people in our team also built it in about 5 minutes. A few months ago, when I ran Ubuntu in a VM on a Windows machine, the build took an average of 15-20 minutes.
>Build the project The slowest component usually takes 3-4 minutes. The interesting thing about this component is that there is very little code. In fact, it is just a test case and a resource file of 135 MB. In 3-4 minutes, I calculated the “copy 63 resources” for about 100 seconds.
>Run in OSX safe mode, it only takes 42 seconds to build the slowest component mentioned above, of which about 7 seconds are spent copying 63 resources.

I’m not sure what else can be tried at this point, but I feel that I am very close to nailing it. If there is not such a significant difference, I would not be so worried, but in my workflow Among them, 15 minutes is huge to 5 minutes. I feel very uncomfortable when I hand over my work computer to the Apple Genius guy. Our IT staff is not a Mac person. Reinstalling the operating system seems to be the answer I saw on the Internet. But this seems a bit overwhelming and intrusive. (I know this may be an OSX issue, not a Maven issue, but Maven is my benchmark. I haven’t noticed any other slowness, but it’s hard to say not using someone else’s computer)

Has anyone encountered such a thing? Any ideas on what to try? Thank you

Run the mvn -X… command on your computer, and run mvn on the fast computer -X… command and compare the time spent by tasks/plugins in the log file. This should give you a starting point. The two slowest parts are file system scanning and network access to check artifacts/dependencies/plugin updates .

The former can be improved by adjusting disk access (such as caching or switching to SSD).

The latter can be improved by adding a Maven repository manager, such as Nexus Or Artifactory, they can cache and optimize access to all remote Maven repositories.

I recently had a new Macbook Pro working and noticed that it was built in Maven2 Our code base takes about 15 minutes, while others in my team use a slightly old Macbook (but similar/same specifications) to build in about 5 minutes. After asking around, I found another one in the team Man, his build takes 15 minutes. I’m talking about a new code check, all of us use the same version of Maven (2.2.1) and Java version: 1.6.0_29, run’mvn clean install from the root of the project ‘. Both of our slow builds are on Lion (10.7.3), and the one who built in 5 minutes is on Lion or Snow Leopard. My machine has 8GB RAM and 2.3 GHz i7, so it doesn’t seem to be a problem . AFAIK, this machine is equipped with Lion (rather than upgrading from Snow Leopard), so I don’t think it is upgraded from Snow Leopard, it seems that some people have problems. Our slow builds all have 5400 rpm drives, and Most of the others have 7200 rpm drives, but one of the others who has a 5-minute build has exactly the same 5400 rpm drives as ours…so such a rule out of that theory.

I ran the memory test (checked out normal), ran disk verification and permission repair in Disk Utility (fixed some permission issues, but did not change the build time), disabled swap, made sure that filevault was closed, built from a different directory, everything to no avail .Some interesting points made me suspect the operating system problem:

>I installed an Ubuntu virtual machine on this machine, and doing’mvn clean install’ there is even faster than the native machine in OSX Much (10 minutes vs. 15 minutes)! FYI, the local Ubuntu people in our team also built it in about 5 minutes. A few months ago, when I ran Ubuntu in a VM on a Windows machine, the build took an average of 15-20 minutes.
>Build the project The slowest component usually takes 3-4 minutes. The interesting thing about this component is that there is very little code. In fact, it is just a test case and a resource file of 135 MB. In 3-4 minutes, I calculated the “copy 63 resources” for about 100 seconds.
>Run in OSX safe mode, it only takes 42 seconds to build the slowest component mentioned above, of which about 7 seconds are spent copying 63 resources.

I’m not sure what else can be tried at this point, but I feel that I am very close to nailing it. If there is not such a significant difference, I would not be so worried, but in my workflow Among them, 15 minutes is huge to 5 minutes. I feel very uncomfortable when I hand over my work computer to the Apple Genius guy. Our IT staff is not a Mac person. Reinstalling the operating system seems to be the answer I saw on the Internet. But this seems a bit overwhelming and intrusive. (I know this may be an OSX issue, not a Maven issue, but Maven is my benchmark. I haven’t noticed any other slowness, but it’s hard to say not using someone else’s computer)

Has anyone encountered such a thing? Any ideas on what to try? Thank you

Run the mvn -X …command on your computer, and run the mvn -X …command on the fast computer, and compare the tasks in the log files /Plugin time. This should give you a starting point. The two slowest parts are file system scanning and network access, which are used to check artifacts/dependencies/plugin updates.

The former It can be improved by adjusting disk access (such as caching or switching to SSD).

The latter can be improved by adding a Maven repository manager, such as Nexus or Artifactory, which can cache and optimize all remote Maven Access to the repository.

Leave a Comment

Your email address will not be published.