#2329 view_commits branch compare optimization
Merged by clime. Opened by clime.
Unknown source master

Download 2329.patch

Instead of incorrect PR#2328, I made this patch instead. This should cover all the cases of possible branching (forking first or branching in the orig repo), be faster and less memory-demanding. The algorithm tries to walk through minimum number of nodes while looking for intersection between compare branch and current branch.

You are right and this is the right approach, however I think we should be able to reuse the code in pagure.lib.git more precisely the method get_diff_info(repo_obj, orig_repo, branch_from, branch_to) which should do the same algorithm as the one you implemented here but allows re-using existing code :)

Feel free to force-push to the same branch, pagure will update the PR automatically.

And thanks again for catching this one, it's an oversight on my part.

rebased

I updated the PR. Please, take a look.

This is looking good, I'll run the tests locally and merge manually to save you the rebase if they pass.

From your tests does it improve the speed?

Thanks!

Yes, it does. It is again about 6s for the load of /commits of that huge gecko-dev repo.

For the previous version, it was 15s.

I had to fix a small coding style error but otherwise tests pass and local test also looks good.

Thanks for the patch!

Commit 7030357b fixes this pull-request

Pull-Request has been merged by clime@redhat.com

Metadata