psiroky commented on PR #166:
URL: https://github.com/apache/maven-resolver/pull/166#issuecomment-1413808333

   I _believe_ this change is the cause behind the "slowness" I am seeing when 
comparing Maven 3.9.0 and 3.8.7. See 
https://lists.apache.org/thread/r9p236z8kvqqk7ykvkgmc5wgps6n1hkf for some 
numbers comparing couple of different builds on 3.9.0 and 3.8.7.
   
   From what I was able to observe (using async-profiler and JFR/JMC) the 
number of created instances of `org.eclipse.aether.artifact.DefaultArtifact` is 
about 4 times higher with 3.9.0 (and the logic in the constructor is somewhat 
"complex", merging maps, which takes time and creates quite a lot "garbage"). 
For small projects this is not really noticeable (e.g. if you create 1k or 4k 
instances that is not something to noticeable slow down the build). However, 
for big multi-module projects (like e.g. Quarkus which I am using for testing), 
the difference is ~2mil objects vs ~8mil objects and that adds up.
   
   I have tried to revert this commit (on current maven-resolver master, since 
it is basically the same as version 1.9.4 which is used in 3.9.0) and then 
build the 3.9.x branch with that version (1.9.5-SNAPSHOT) -- and the result is 
that the build times are basically equal to those of 3.8.7.
   
   At this point I am not saying this change is bad or so, maybe we need to do 
adjustments elsewhere. Also, even ~2mil created 
`org.eclipse.aether.artifact.DefaultArtifact` seems like a lot, so maybe there 
is a space for some more aggressive caching (I am just speculating, since I 
have not studied the code in depth yet).
   
   Sorry for hijacking this old PR, but I wanted to let you know asap. I am 
planning to create a proper JIRA, but before that I need to gather a bit more 
data and double-check my findings.
   
   


-- 
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: issues-unsubscr...@maven.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to