- attached issuecount_maxresults0.jpg
issuecount job unnecessarily retrieves data when only count is needed
The issuecount job sets a maxresults number of 200 by default. This results in data for each issue that matches the query being returned in the result. By setting maxResults to 0, and using the total field in the response that can be avoided, and there is no artificial upper limit imposed on the count. Performance is also consistent over queries that have between 0 and 350K results.
Rough benchmarks (using chrome network profiling data, screenshot attached) maxResults = 200 4-6 second response time and 157 KB payload maxresults=0 220-420 ms response time and 469 B payload
Change line 73 to:
// maxResults 0 since we only want the count, which is stored in data.total
options.url = baseUrl + qs.stringify({jql: item.jql, maxResults: 0});
Change lIne 84 to:
// maxResults set to 0 in call, so number of results in total
ret.count = data.total;
I'll workup a pull request after searching if there are any other jobs that could utilize this optimization
Comments (3)
-
reporter -
reporter - edited description
-
- changed status to resolved
Fix has been merged. Thanks Tony for the suggested solution.
- Log in to comment