takari / polyglot-maven

Support alternative markup for Apache Maven POM files
Eclipse Public License 1.0
893 stars 101 forks source link

Minimize 'locatePom()'-calls in PolyglotModelManager #242

Closed HannesWell closed 2 years ago

HannesWell commented 2 years ago

For some Mapping implementations calling locatePom() can be a relatively expensive operation, for example because it includes many file-system interactions.

Because only the result of the mapping with the highest priority is returned eventually, findPom() and determineFlavourFromPom() can be speed-up if Mappings are processed in descending priority-order and simply return the first encountered result. Just like the other get*() methods do.

Additionally this PR simplifies the implementation of getSortedMappings() at bit.

HannesWell commented 2 years ago

@jvanzyl can you please have a look at this PR?

HannesWell commented 2 years ago

Thank you @fbricon do you know of any plans about the next release that contains this change? And are there snapshot builds available anywhere?

jvanzyl commented 2 years ago

@HannesWell I just made a release, should be in Maven Central shortly.

HannesWell commented 2 years ago

Great! Thank you.