Uploaded image for project: 'Maven'
  1. Maven
  2. MNG-7659

ComparableVersion cache

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 3.8.7
    • None
    • None
    • None

    Description

      Tobias Gruetzmacher has raised an issue with Versions Maven Plugin - Performance issue with many versions/artifacts #869, where he points out that we're creating lots of ComparableVersion objects (which happens especially during ArtifactVersion comparison), which affects performance. He proposed creating a simple cache for these objects.

      This proved to increase performance in some Versions Maven Plugin jobs almost twofold.

      What do you guys think of introducing this to Maven?

      The cache should probably be restricted in size (e.g. use LRUMap from commons collections), so that it won't leak memory when used with mvnd.

      Simple implementation is here: https://github.com/mojohaus/versions/pull/870

      Using LRUMap: https://github.com/mojohaus/versions/pull/893

      The cache could alternatively be owned by DefaultArtifactVersion, where the construction of ComparableVersion is taking place.

      I'm querying for opinions on this; if this gains approval, I could implement it. Ultimately I'd like to get rid of the ComparableVersion duplicate in Versions Maven Plugin.

      Attachments

        Activity

          People

            Unassigned Unassigned
            ajarmoniuk Andrzej Jarmoniuk
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: