SAP DefaultVersionManager & CachingVersionStore Optimization

XMLWordPrintable

    • Type: Suggestion
    • Resolution: Fixed
    • Component/s: None

      NOTE: This suggestion is for JIRA Cloud. Using JIRA Server? See the corresponding suggestion.

      Package: com.atlassian.jira.project.version

      Usage Scenario: The caching version store caches versions and can map version ids to versions. The DefaultVersionManager makes use of the caching version store. In our JIRA instance there are more than 20.000 versions.

      Current Implementation: For some methods the DefaultVersionManager has to iterate through all 20.000 versions and has to check for each version if a certain condition is fulfilled. Example:

      public Collection<Version> getVersionsByName(final String versionName)
      {
      ..
        final List<GenericValue> versionGvs = versionStore.getAllVersions(); ...
        CollectionUtil.foreach(versionGvs, consumer); ...
        return filteredVersions;
      }
      

      Especially in the parsing of JQL queries this method is called very often.

      One Alternative Implementation: Extend the caching by two further caches, one that gives all versions of a given project and one that gives all version of a given name (case insensitive).

      class Caches 
      {
        Map versionCache;
        Map<Long, List<Long>> versionIdsByProjectIdCache;
        Map<String, List<Long>> versionIdsByNameCache;
      }
      

      Make use of the two new caches in the methods of DefaultVersionManager wherever possible.

            Assignee:
            Trevor Campbell (Inactive)
            Reporter:
            Rick (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: