Petr Široký created MNG-7677:
--------------------------------

             Summary: Maven 3.9.0 is ~10% slower than 3.8.7 in large 
multi-module builds
                 Key: MNG-7677
                 URL: https://issues.apache.org/jira/browse/MNG-7677
             Project: Maven
          Issue Type: Bug
          Components: Performance
    Affects Versions: 3.9.0
            Reporter: Petr Široký


When testing the upcoming [Maven release 
3.9.0|https://repository.apache.org/content/repositories/maven-1862/org/apache/maven/apache-maven/3.9.0/apache-maven-3.9.0-bin.tar.gz]
 I noticed the builds for large multi-module projects are somewhat slower.

I was mainly using the [Quarkus projects|https://github.com/quarkusio/quarkus], 
which has more than 1k modules. I was specifically bulding the {{2.16.1.Final}} 
tag. Below are the numbers I got.
**

First batch:
{code:java}
MAVEN_OPTS="-XX:+UseParallelGC -Xms2g -Xmx2g"{code}
||Maven cmd||Build time - Maven 3.8.7||Build time - Maven 3.9.0||
|clean|2.9s|3.2s|
|validate|02:17min|02:34min|
|validate -T8|29s|33s|
|validate -Dversion.enforcer.plugin=3.2.1|29s|40s|
|validate -Dversion.enforcer.plugin=3.2.1 -T8|9s|14s|

Second batch (bigger heap):
{code:java}
MAVEN_OPTS="-XX:+UseParallelGC -Xms5g -Xmx5g"{code}
||Maven cmd||Build time - Maven 3.8.7||Build time - Maven 3.9.0||
|clean|2.9s|3.2s|
|validate|02:11min|02:22min|
|validate -T8|25s|28s|
|validate -Dversion.enforcer.plugin=3.2.1|29s|35s|
|validate -Dversion.enforcer.plugin=3.2.1 -T8|9s|11s|
|install -DskipTests -Dversion.enforcer.plugin=3.2.1 -T8|01:49min|01:55min|

*Notes:*
 * The numbers are taken from the Maven output (the Wall Clock time). When 
testing with the time utility, the "real" execution time is about 0.6s longer 
(the time JVM needs to start-up)
 * All builds were run on Linux x64 (kernel 6.1.8) with JDK 19.0.1
 * HW used during testing: AMD Ryzen 5800x (8 physical cores), 32GB RAM and SSD 
Samsung 980 Pro 1TB (these should not really matter for the comparison itself, 
but I am including it for completeness)
 * Using {{ParallelGC}} since it should be the one with highest throughput (at 
the cost of longer pause times, which I don't really care about for Maven 
builds). Quick comparison with {{G1GC}} shows the builds are slightly faster, 
but it is almost negligible.

There has already been some discussion regarding this in this older merged PR 
[https://github.com/apache/maven-resolver/pull/166] (which may be the cause 
behind the slowdown).

TODO: I would like to provide some more data I got from the analysis with 
async-profiler / JFR.

TODO:



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to