Skip to content

Improve performance of PR import

Kamil Trzciński requested to merge fix-pull-request-importer into master

What does this MR do?

The merge_requests.reload.find makes AR to load ALL Merge Requests for given project. This results in PullRequestImporter to have O(n) complexity and memory pressure (n - number of already imported PR).

The .reload is not needed as the .find always perform SQL query to find given object.

After that change importing pull requests from https://github.com/gitlabhq/gitlabhq have the very constant time between 0.01-1s for me, instead of 10-40s at the end of the process.

This happens for the following reason: Screenshot_from_2019-04-08_14-17-30

Conformity

Performance and testing

If cross-browser testing is not required, please remove the relevant item, or mark it as not needed: [-] -->

Edited by Kamil Trzciński

Merge request reports