stable

Clone or download

Read-only

request #12284: Getting the list of the impacted files of a PR through the REST API can be slow

With a PR changing a lot of files the REST route GET /pull_requests/{id}/files becomes slow. The existing code does 1+<nb_changed_files> calls to exec(), calls to exec() being expensive when the number of files grow the majority of the processing time is wasted on it. This contribution achieve the same calculation with 2 calls to exec() whatever the number of files changed. Better results could still be obtained but this contribution should be enough to achieve sustainable performance for now. Change-Id: I9389ff67d7d339a0e3ef3b127c07f5e61da2a526

Modified Files

Name
M plugins/pullrequest/include/PullRequest/GitExec.php +19 −14 Go to diff View file
M plugins/pullrequest/include/PullRequest/REST/v1/PullRequestFileRepresentationFactory.php +47 −8 Go to diff View file
M plugins/pullrequest/tests/GitExecTest.php +6 −12 Go to diff View file