You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by GitBox <gi...@apache.org> on 2019/06/28 15:06:48 UTC

[GitHub] [maven] gnodet commented on issue #259: [MNG-6693] Various speed improvements

gnodet commented on issue #259: [MNG-6693] Various speed improvements
URL: https://github.com/apache/maven/pull/259#issuecomment-506768131
 
 
   How ? You mean why each change helps improving performance or how did I measure the effect ? or how did i find those ?
   For the _what_, my main goal is to speed up `time mvn foo` when running the build on https://github.com/apache/camel, so that's easily reproducible.  Currently, with 3.6.1, it takes more than 50s.  I'm now slightly above 30s with all the included changes.
   As for the _how_, I'm using YourKit profile to find out the spots that takes times.  I've been spending a lot of time trying to improve the model building mechanism in various ways, but could not get any significant results, so I'm back to a bunch of smaller improvements, which is the subject of this PR.
   For the specifics, it depends:
     - using regexp is quite slow for simple checks, so checking if there's a '-' in a string is *way* faster than running the regexp in the first place, so if we can avoid it, it's better
     - avoid running the full model interpolation on the parent if the version is not to be interpolated
     - speed up the string search interpolator by reusing the plexus interpolator instead of adding / removing the same value sources / processors each time
     - cache valid ids (they are mostly always the same)
     - avoid concatenating strings which are not used (during validation, as they are only used when there's a violation)
     - the second commit provides a full blown new model interpolator which does not use reflection and is much master
     - the third commit does early checking before calling `Validate.notBlank` which proves to be quite slow when called a few million times
   

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services