Re: [PERF] Maven 4 performance on large reactors — 2:45 → 1:18 (parity with Maven 3)

Sergey Chernov <[email protected]> Mon, 3 Aug 2026 22:00:20 +0200
Newsgroups gmane.comp.jakarta.turbine.maven.devel
Message-ID <CAJ-bKnmMAA5TAx_=iqhODJTb9tbahRsuR9rkg8NJ=iadLMO41A@mail.gmail.com>
--0000000000009c3fed065829fd5e
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Nice. Thanks, will try to assemble this locally and will let you know
regarding the build times.

On Mon, Aug 3, 2026 at 2:01=E2=80=AFPM Guillaume Nodet <gnodet.apache@gmail=
.com>
wrote:

> Hi all,
>
> I've been profiling Maven 4 RC6 on a large reactor (4,383 modules,
> diamond-graph, generated with maven-multiproject-generator) as several
> performance regressions were found during in the vote thread compared to
> Maven 3. A clean install -DskipTests that takes ~1:15 on Maven 3.9.16 was
> taking ~2:45 on Maven 4 RC6.
>
> After a series of JFR-guided optimizations across 4 repositories, Maven 4
> now completes the same build in ~1:18 =E2=80=94 at parity with Maven 3.
>
> Benchmark (Apple M4 Pro, JDK 21):
>
> | Configuration | Wall time |
> |----------------------------|----------------|
> | Maven 3.9.16 | 1:14 =E2=80=93 1:18 |
> | Maven 4 RC6 (unpatched) | 2:45 |
> | + all optimizations | 1:18 |
>
> The full analysis (JFR hotspots, root causes, complexity reductions) and
> all 8 PRs are tracked in:
> https://github.com/apache/maven/issues/12667
>
> The main wins are:
> 1. Switching the default conflict resolver from classic (O(N=C2=B2)) to p=
ath
> (O(N)) =E2=80=94 single biggest win, 2:45 =E2=86=92 1:45
> 2. TransitiveDependencyManager optimizations =E2=80=94 instance reuse, co=
ns-list
> parent pointer, varargs elimination
> 3. Reactor sort O(N=C2=B2 log N) =E2=86=92 O(N log N), model building pip=
eline
> allocation reduction
> 4. Install/Deploy plugin O(N=C2=B2) reactor scans =E2=86=92 O(N) with cac=
hing
>
> All PRs are green and ready for review.
>
> Regards,
> Guillaume
>

--0000000000009c3fed065829fd5e--