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

use int or long instead of BigIntegers for little numbers in ComparableVersion

    XMLWordPrintableJSON

Details

    Description

      while working on MNG-6571, we found that this could enhance performance when many versions are compared: perhaps not in Maven builds, since this is probably negligible, but in other scenario where version comparison is used, this could be useful

      see https://github.com/apache/maven/blob/master/maven-artifact/src/main/java/org/apache/maven/artifact/versioning/ComparableVersion.java
      for every Integer, a BigInteger is currently used
      but for integer that have less than 10 digits, an int would be sufficient and would be a lot more efficient
      and for integers that are less than 19 digits, a long would be the way to go

      the biggest numbers we get usually is the timestamp of a SNAPSHOT, like 20171015.230843 (YYYYMMDD.HHmmss), then an int will be sufficient in the vast majority of case

      Attachments

        Issue Links

          Activity

            People

              hboutemy Herve Boutemy
              hboutemy Herve Boutemy
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 20m
                  20m