Details
-
Type:
Improvement
-
Status:
Open
-
Priority:
Minor
-
Resolution: Unresolved
-
Affects Version/s: 3.0.3
-
Fix Version/s: None
-
Component/s: Inheritance and Interpolation
-
Labels:None
-
Environment:Maven 3.0.3 trunk
-
Complexity:Intermediate
-
Number of attachments :
Description
Currently I am investigating performance problems with the large project trees (100+ projects).
The main cause is the Netbeans Maven Plugin, but I also found and fixed a bottleneck in Maven itself, in class org.apache.maven.model.interpolation.StringSearchModelInterpolator.
I created a patch against the today's Maven 3 trunk, https://svn.apache.org/repos/asf/maven/maven-3/trunk.
It does following:
- don't use AccessController if no SecurityManager is active.
- don't call java.lang.reflect.Field.setAccessible(false). It is not necessary, because the Field object are never exposed to outside the class.
- getFields(Class) now determines which fields are qualified for interpolation, instead of determining it again on each call to traverseObjectWithParents().
The behaviour is exactly the same as before. The performance is much better. Formerly about 12500 ms for all projects, now about
4500, where most of the CPU time is consumed by StringSearchModelInterpolator.interpolateInternal().
Attached patch.