[ 
https://issues.apache.org/jira/browse/MNG-6311?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16701106#comment-16701106
 ] 

Mickael Istria commented on MNG-6311:
-------------------------------------

Please have a look at this test case: https://github.com/apache/maven/pull/194 
. It fails with current master.
If you `git revert 8bc3c207d0aa7cef72171af23d9c4667b2d46c5d`, it succeeds, as 
expected.
In the current form, the contract of `ProjectBuilder.build(...)` is broken as 
it doesn't resolve the MavenProject correctly.

This is a severe regression, and I think it should really be avoided in Maven 
before it cascade to m2e or other projects that use the ProjectBuilder API to 
do some validation or any other form of analysis.
I suggest this gets reverted, we merge my unit-test that guarantees a good 
functioning state for `ProjectBuilder.build(...)` and the patch gets reworked 
to not introduce a regression. This is the only safe path.

Note that while I may seem very opposed to this change, I am actually not at 
all. I just want to make the API still work as expected.
I think there are way to rework the suggested patch so it doesn't introduce 
that regression.

> Maven intolerably slow when import scope used heavily in large project
> ----------------------------------------------------------------------
>
>                 Key: MNG-6311
>                 URL: https://issues.apache.org/jira/browse/MNG-6311
>             Project: Maven
>          Issue Type: Bug
>          Components: core, Performance
>    Affects Versions: 3.5.0, 3.5.2
>            Reporter: David Churcher
>            Assignee: Sylwester Lachiewicz
>            Priority: Major
>              Labels: performance
>             Fix For: 3.6.0
>
>         Attachments: Call-tree-–-All-threads-together.html, 
> anon-hierarchy-maven-output.zip, modelcachefix.diff
>
>
> I have a build performance problem that is identical to MNG-5312, and has 
> appeared since MNG-6030 in Maven v3.5.0 reversed the patch for MNG-5312, 
> removing the ModelCache from some of the overloads for 
> DefaultProjectBuilder.build. 
> As in MNG-5312 the problem is in a large proprietary project. It uses up to 8 
> levels of parent POMs, many of which use the import scope and have large 
> dependency-management sections, and has hundreds of dependencies that also 
> use the same parent POM hierarchy. Adding some logging shows that Maven does 
> over 800,000 uncached reads of parent POM files, which takes about half an 
> hour. With model caching this goes down to a few seconds.
> I've attached a patch that fixes this by using a class-level ModelCache in 
> DefaultProjectBuilder. This does not suffer from the memory usage problems 
> reported in MNG-6030.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to