Uploaded image for project: 'Jira Server and Data Center'
  1. Jira Server and Data Center
  2. JRASERVER-36368

JQL Issue functions have major performance issues




      I have used the JQL function module quite a lot in my plugin, JQL Tricks. It is a really useful plugin module to extend JIRA's search capabilities and works well for most cases.

      But with the growing list of enterprise customers, performance has become a great problem. After introducing many improvements to the new JQL functions, there still a bottleneck which appears to be coming from IssueIdValidator.

      The problem comes when the return type is ISSUE. It is very convinient as it lets users search with clauses like "issue in .." but SearchService adds a lot of load in such cases because of the extra validations. For example, if a query returns 40K issues, IssueIdValidator verifies that each of the issue id is a valid one. This extra validation is sometimes totally useless because permissions are already checked once. But there is no way to override it as pe the current architecture

      This is completely unrelated to JQL Tricks or any other plugin as I reproduced the same issue with a simple plugin where I used the following query directly in issue navigator and in a simple JQL function that returns issues matching the same. The time taken to return the result using the JQL function is a lot more than the direct usage.

      issuetype in standardIssueTypes()

      To make sure, I have added profile logs in the code and here is the result.

      2013-12-10 22:08:42,375 http-8080-3 DEBUG jobinkk 1327x325x1 1ue9yju 0:0:0:0:0:0:0:1%0 /secure/IssueNavigator!executeAdvanced.jspa [atlassian.util.profiling.UtilTimerStack] [72132ms] - /secure/IssueNavigator!executeAdvanced.jspa
        [33017ms] - IssueNavigator.execute()
          [2513ms] - Test JQL Function
            [75ms] - Lucene Query
              [0ms] - IssueIndexManager.getIssueSearcher()
              [15ms] - Permission Query
                [9ms] - PermissionManager.getProjects()
                [0ms] - List.iterator()
                [0ms] - Iterator.hasNext()

      Out of the 33017ms, the plugin code takes only 2513ms. Attached is the code used in the test plugin. You can reproduce the numbers in a test instance with a large number of issues.

      There should be a way to either skip the validation or do is faster.


          Issue Links



              ohernandez@atlassian.com Oswaldo Hernandez (Inactive)
              jobinkk@gmail.com Jobin Kuruvilla [Adaptavist]
              35 Vote for this issue
              48 Start watching this issue