gnodet opened a new pull request, #14216:
URL: https://github.com/apache/maven/pull/14216

   Forward-port of #14186 from `maven-4.0.x` to `master`.
   
   ## Summary
   
   The concurrent builder (`-bconcurrent`) had three sources of O(N²) overhead
   that made it unusable on large reactors. On an 813-module project,
   `mvn validate -bconcurrent -T4` took **~49 seconds** vs **~2.5 seconds** for 
the
   multithreaded builder. After these fixes it takes **~2.6 seconds**.
   
   1. Replace the O(N²) full-plan scan in `executePlan()` with a push-based
      ready queue: each step tracks its pending predecessor count via an
      `AtomicInteger`, and `notifySuccessors()` enqueues steps that reach zero.
   
   2. Track predecessor failure via an `AtomicBoolean` flag propagated in
      `notifySuccessors()`, replacing O(predecessors) stream scans in
      `processStep()` with O(1) flag reads.
   
   3. Add `executeAfterUnchecked()` that skips the O(graph) recursive
      `isSuccessorOf()` cycle check, used during plan construction where
      acyclicity is structurally guaranteed.
   
   4. Fix race condition in `initReadyQueue` counter initialization (count all 
predecessors, not just non-done).
   
   5. Fix `pendingPredecessors` update when edges are added after 
initialization.
   
   Cherry-picked from `a7bc1d4aef7a1fd753350895c296c6374a55206a` with minor 
adaptation for master (10-param `BuildPlanExecutor` constructor in test helper).
   
   - [x] I hereby declare this contribution to be licensed under the [Apache 
License Version 2.0, January 2004](https://www.apache.org/licenses/LICENSE-2.0)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to